Skip to content

Commit

Permalink
Add run configs
Browse files Browse the repository at this point in the history
  • Loading branch information
hegyibalint committed Nov 13, 2024
1 parent a612d45 commit a9b700b
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 5 deletions.
44 changes: 44 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import org.jetbrains.gradle.ext.Remote
import org.jetbrains.gradle.ext.runConfigurations
import org.jetbrains.gradle.ext.settings

/*
* Copyright 2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
id("org.jetbrains.gradle.plugin.idea-ext") version "1.1.9"
}

idea.project.settings {
runConfigurations {
runConfigurations {
create<Remote>("Attaching debugger 5010") {
mode = Remote.RemoteMode.ATTACH
transport = Remote.RemoteTransport.SOCKET
sharedMemoryAddress = "javadebug"
host = "localhost"
port = 5010
}
create<Remote>("Listening debugger 5011") {
mode = Remote.RemoteMode.LISTEN
transport = Remote.RemoteTransport.SOCKET
sharedMemoryAddress = "javadebug"
host = "localhost"
port = 5011
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,12 @@ class DeclarativeTextDocumentService : TextDocumentService {
val uri = URI(it.textDocument.uri)
val text = it.textDocument.text
val dom = parse(uri, text)
documentStore.storeInitial(uri, text, dom)
processDocument(uri)
if (dom != null) {
documentStore.storeInitial(uri, text, dom)
processDocument(uri)
} else {
documentStore.remove(uri)
}
}
}

Expand All @@ -117,8 +121,12 @@ class DeclarativeTextDocumentService : TextDocumentService {
val version = it.textDocument.version
val text = change.text
val dom = parse(uri, change.text)
documentStore.storeVersioned(uri, version, text, dom)
processDocument(uri)
if (dom != null) {
documentStore.storeVersioned(uri, version, text, dom)
processDocument(uri)
} else {
documentStore.remove(uri)
}
}
}
}
Expand Down Expand Up @@ -296,7 +304,7 @@ class DeclarativeTextDocumentService : TextDocumentService {
)
}

private fun parse(uri: URI, text: String): DocumentOverlayResult {
private fun parse(uri: URI, text: String): DocumentOverlayResult? {
val fileName = uri.path.substringAfterLast('/')
val fileSchema = schemaAnalysisEvaluator.evaluate(fileName, text)
val settingsSchema = schemaAnalysisEvaluator.evaluate(
Expand Down

0 comments on commit a9b700b

Please sign in to comment.