@likec4/language-server 1.21.0 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/bin/likec4-language-server.mjs +5 -2
- package/dist/LikeC4FileSystem.js +2 -2
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js +17 -2
- package/dist/bundled.d.ts +8 -0
- package/dist/bundled.js +25 -0
- package/dist/bundled.mjs +2587 -4306
- package/dist/generated-lib/icons.js +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +23 -2
- package/dist/logger.d.ts +9 -3
- package/dist/logger.js +35 -55
- package/dist/model/fqn-computation.js +2 -2
- package/dist/model/model-builder.js +13 -14
- package/dist/model-change/ModelChanges.js +2 -2
- package/dist/module.js +1 -4
- package/dist/references/scope-provider.js +3 -3
- package/dist/view-utils/manual-layout.js +2 -2
- package/dist/views/configurable-layouter.js +4 -4
- package/dist/views/likec4-views.d.ts +2 -1
- package/dist/views/likec4-views.js +2 -2
- package/package.json +14 -14
- package/dist/test/setup.d.ts +0 -1
- package/dist/test/setup.js +0 -7
- package/src/LikeC4FileSystem.ts +0 -38
- package/src/Rpc.ts +0 -134
- package/src/ast.ts +0 -556
- package/src/browser.ts +0 -35
- package/src/documentation/documentation-provider.ts +0 -52
- package/src/documentation/index.ts +0 -1
- package/src/formatting/LikeC4Formatter.ts +0 -639
- package/src/formatting/utils.ts +0 -26
- package/src/generated/ast.ts +0 -3735
- package/src/generated/grammar.ts +0 -10
- package/src/generated/module.ts +0 -33
- package/src/generated-lib/icons.ts +0 -1537
- package/src/index.ts +0 -30
- package/src/like-c4.langium +0 -901
- package/src/likec4lib.ts +0 -6
- package/src/logger.ts +0 -80
- package/src/lsp/CodeLensProvider.ts +0 -50
- package/src/lsp/CompletionProvider.ts +0 -147
- package/src/lsp/DocumentHighlightProvider.ts +0 -12
- package/src/lsp/DocumentLinkProvider.ts +0 -65
- package/src/lsp/DocumentSymbolProvider.ts +0 -313
- package/src/lsp/HoverProvider.ts +0 -92
- package/src/lsp/RenameProvider.ts +0 -8
- package/src/lsp/SemanticTokenProvider.ts +0 -383
- package/src/lsp/index.ts +0 -8
- package/src/model/deployments-index.ts +0 -209
- package/src/model/fqn-computation.ts +0 -83
- package/src/model/fqn-index.ts +0 -138
- package/src/model/index.ts +0 -6
- package/src/model/model-builder.ts +0 -724
- package/src/model/model-locator.ts +0 -146
- package/src/model/model-parser-where.ts +0 -84
- package/src/model/model-parser.ts +0 -86
- package/src/model/parser/Base.ts +0 -113
- package/src/model/parser/DeploymentModelParser.ts +0 -192
- package/src/model/parser/DeploymentViewParser.ts +0 -122
- package/src/model/parser/FqnRefParser.ts +0 -143
- package/src/model/parser/GlobalsParser.ts +0 -96
- package/src/model/parser/ModelParser.ts +0 -170
- package/src/model/parser/PredicatesParser.ts +0 -315
- package/src/model/parser/SpecificationParser.ts +0 -133
- package/src/model/parser/ViewsParser.ts +0 -428
- package/src/model-change/ModelChanges.ts +0 -101
- package/src/model-change/changeElementStyle.ts +0 -172
- package/src/model-change/changeViewLayout.ts +0 -47
- package/src/model-change/saveManualLayout.ts +0 -41
- package/src/module.ts +0 -255
- package/src/protocol.ts +0 -93
- package/src/references/index.ts +0 -3
- package/src/references/name-provider.ts +0 -37
- package/src/references/scope-computation.ts +0 -364
- package/src/references/scope-provider.ts +0 -201
- package/src/shared/NodeKindProvider.ts +0 -121
- package/src/shared/WorkspaceManager.ts +0 -48
- package/src/shared/WorkspaceSymbolProvider.ts +0 -3
- package/src/shared/index.ts +0 -3
- package/src/test/index.ts +0 -1
- package/src/test/setup.ts +0 -8
- package/src/test/testServices.ts +0 -152
- package/src/utils/disposable.ts +0 -30
- package/src/utils/elementRef.ts +0 -26
- package/src/utils/fqnRef.ts +0 -56
- package/src/utils/index.ts +0 -2
- package/src/utils/printDocs.ts +0 -3
- package/src/utils/stringHash.ts +0 -6
- package/src/validation/_shared.ts +0 -29
- package/src/validation/deployment-checks.ts +0 -131
- package/src/validation/dynamic-view-rule.ts +0 -23
- package/src/validation/dynamic-view-step.ts +0 -36
- package/src/validation/element.ts +0 -56
- package/src/validation/index.ts +0 -171
- package/src/validation/property-checks.ts +0 -52
- package/src/validation/relation.ts +0 -63
- package/src/validation/specification.ts +0 -205
- package/src/validation/view-predicates/element-with.ts +0 -36
- package/src/validation/view-predicates/expanded-element.ts +0 -16
- package/src/validation/view-predicates/expression-v2.ts +0 -101
- package/src/validation/view-predicates/incoming.ts +0 -20
- package/src/validation/view-predicates/index.ts +0 -6
- package/src/validation/view-predicates/outgoing.ts +0 -20
- package/src/validation/view-predicates/relation-with.ts +0 -17
- package/src/validation/view.ts +0 -37
- package/src/view-utils/assignNavigateTo.ts +0 -31
- package/src/view-utils/index.ts +0 -2
- package/src/view-utils/manual-layout.ts +0 -116
- package/src/view-utils/resolve-relative-paths.ts +0 -90
- package/src/views/configurable-layouter.ts +0 -65
- package/src/views/index.ts +0 -1
- package/src/views/likec4-views.ts +0 -139
package/src/browser.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { startLanguageServer as startLanguim } from 'langium/lsp'
|
|
2
|
-
import { BrowserMessageReader, BrowserMessageWriter, createConnection } from 'vscode-languageserver/browser'
|
|
3
|
-
import { type LikeC4Services, type LikeC4SharedServices, createLanguageServices } from './module'
|
|
4
|
-
|
|
5
|
-
export { logger as lspLogger, setLogLevel } from './logger'
|
|
6
|
-
export type { DocumentParser, LikeC4ModelBuilder, LikeC4ModelLocator, LikeC4ModelParser } from './model'
|
|
7
|
-
|
|
8
|
-
export { createCustomLanguageServices, createLanguageServices, LikeC4Module } from './module'
|
|
9
|
-
export type { LikeC4Services, LikeC4SharedServices } from './module'
|
|
10
|
-
export type { LikeC4Views } from './views'
|
|
11
|
-
|
|
12
|
-
// This is an example copied as is from here:
|
|
13
|
-
// https://github.com/microsoft/vscode-extension-samples/blob/main/lsp-web-extension-sample/server/src/browserServerMain.ts
|
|
14
|
-
// the only addition is the following line:
|
|
15
|
-
declare const self: DedicatedWorkerGlobalScope
|
|
16
|
-
|
|
17
|
-
export function startLanguageServer(): {
|
|
18
|
-
shared: LikeC4SharedServices
|
|
19
|
-
likec4: LikeC4Services
|
|
20
|
-
} {
|
|
21
|
-
/* browser specific setup code */
|
|
22
|
-
|
|
23
|
-
const messageReader = new BrowserMessageReader(self)
|
|
24
|
-
const messageWriter = new BrowserMessageWriter(self)
|
|
25
|
-
|
|
26
|
-
const connection = createConnection(messageReader, messageWriter)
|
|
27
|
-
|
|
28
|
-
// Inject the shared services and language-specific services
|
|
29
|
-
const services = createLanguageServices({ connection })
|
|
30
|
-
|
|
31
|
-
// Start the language server with the shared services
|
|
32
|
-
startLanguim(services.shared)
|
|
33
|
-
|
|
34
|
-
return services
|
|
35
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { type AstNode, type DocumentationProvider, AstUtils } from 'langium'
|
|
2
|
-
import { ast } from '../ast'
|
|
3
|
-
import { logWarnError } from '../logger'
|
|
4
|
-
import type { LikeC4ModelLocator, LikeC4ModelParser } from '../model'
|
|
5
|
-
import type { LikeC4Services } from '../module'
|
|
6
|
-
|
|
7
|
-
export class LikeC4DocumentationProvider implements DocumentationProvider {
|
|
8
|
-
private parser: LikeC4ModelParser
|
|
9
|
-
private locator: LikeC4ModelLocator
|
|
10
|
-
|
|
11
|
-
constructor(services: LikeC4Services) {
|
|
12
|
-
this.parser = services.likec4.ModelParser
|
|
13
|
-
this.locator = services.likec4.ModelLocator
|
|
14
|
-
}
|
|
15
|
-
getDocumentation(node: AstNode): string | undefined {
|
|
16
|
-
try {
|
|
17
|
-
if (ast.isDeploymentNode(node)) {
|
|
18
|
-
const doc = AstUtils.getDocument(node)
|
|
19
|
-
const el = this.parser.forDocument(doc).parseDeploymentNode(node)
|
|
20
|
-
const lines = [el.id as string]
|
|
21
|
-
if (el.title !== node.name) {
|
|
22
|
-
lines.push(' ', `**${el.title}**`)
|
|
23
|
-
}
|
|
24
|
-
return lines.join(' \n')
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (ast.isDeployedInstance(node)) {
|
|
28
|
-
const doc = AstUtils.getDocument(node)
|
|
29
|
-
const instance = this.parser.forDocument(doc).parseDeployedInstance(node)
|
|
30
|
-
const el = this.locator.getParsedElement(instance.element)
|
|
31
|
-
const lines = [instance.id, `_instance of_ ${instance.element}`]
|
|
32
|
-
if (el) {
|
|
33
|
-
lines.push(' ', `**${el.title}**`)
|
|
34
|
-
}
|
|
35
|
-
return lines.join(' \n')
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (ast.isElement(node)) {
|
|
39
|
-
const doc = AstUtils.getDocument(node)
|
|
40
|
-
const el = this.parser.forDocument(doc).parseElement(node)
|
|
41
|
-
if (!el) {
|
|
42
|
-
return
|
|
43
|
-
}
|
|
44
|
-
const lines = [el.id, ' ', `**${el.title}**`]
|
|
45
|
-
return lines.join(' \n')
|
|
46
|
-
}
|
|
47
|
-
} catch (e) {
|
|
48
|
-
logWarnError(e)
|
|
49
|
-
}
|
|
50
|
-
return
|
|
51
|
-
}
|
|
52
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { LikeC4DocumentationProvider } from './documentation-provider'
|