Skip to content

Commit 27674e8

Browse files
authored
Merge pull request #14 from lstreckeisen/CMI-79-Create-SemanticTokenProvider-for-language-server
Cmi 79 create semantic token provider for language server
2 parents 4e62ace + 274cb3e commit 27674e8

File tree

52 files changed

+3442
-226
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3442
-226
lines changed

.github/workflows/sonar.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: SonarCloud Analysis
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
jobs:
9+
sonarqube:
10+
name: SonarQube
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
16+
- name: SonarQube Scan
17+
uses: SonarSource/sonarqube-scan-action@v5
18+
env:
19+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.yarn/install-state.gz

23.6 KB
Binary file not shown.

langium-quickstart.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ This folder contains all necessary files for your language extension.
88
* `src/extension/main.ts` - the main code of the extension, which is responsible for launching a language server and client.
99
* `src/language/context-mapper-dsl.langium` - the grammar definition of your language.
1010
* `src/language/main.ts` - the entry point of the language server process.
11-
* `src/language/context-mapper-dsl-module.ts` - the dependency injection module of your language implementation. Use this to register overridden and added services.
12-
* `src/language/context-mapper-dsl-validator.ts` - an example validator. You should change it to reflect the semantics of your language.
11+
* `src/language/ContextMapperDslModule.ts` - the dependency injection module of your language implementation. Use this to register overridden and added services.
12+
* `src/language/ContextMapperDslValidator.ts` - an example validator. You should change it to reflect the semantics of your language.
1313
* `src/cli/main.ts` - the entry point of the command line interface (CLI) of your language.
1414
* `src/cli/generator.ts` - the code generator used by the CLI to write output files from DSL documents.
1515
* `src/cli/cli-util.ts` - utility code for the CLI.

sonar-project.properties

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
sonar.projectKey=lstreckeisen_context-mapper-language-server
2+
sonar.organization=lstreckeisen
3+
4+
5+
# This is the name and version displayed in the SonarCloud UI.
6+
#sonar.projectName=context-mapper-language-server
7+
#sonar.projectVersion=1.0
8+
9+
10+
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
11+
#sonar.sources=.
12+
13+
# Encoding of the source code. Default is default system encoding
14+
#sonar.sourceEncoding=UTF-8

src/language/context-mapper-dsl-module.ts renamed to src/language/ContextMapperDslModule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
type PartialLangiumServices
99
} from 'langium/lsp'
1010
import { ContextMapperDslGeneratedModule, ContextMapperDslGeneratedSharedModule } from './generated/module.js'
11-
import { ContextMapperDslValidator, registerValidationChecks } from './context-mapper-dsl-validator.js'
11+
import { ContextMapperDslValidator, registerValidationChecks } from './ContextMapperDslValidator.js'
1212
import { ContextMapperDslSemanticTokenProvider } from './semantictokens/ContextMapperDslSemanticTokenProvider.js'
1313

1414
/**
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
import type { ValidationChecks } from 'langium'
22
import type { ContextMapperDslAstType } from './generated/ast.js'
3-
import type { ContextMapperDslServices } from './context-mapper-dsl-module.js'
3+
import type { ContextMapperDslServices } from './ContextMapperDslModule.js'
4+
import { ContextMappingModelValidator } from './validation/ContextMappingModelValidator.js'
5+
import { ValueValidator } from './validation/ValueValidator.js'
46

57
/**
68
* Register custom validation checks.
79
*/
810
export function registerValidationChecks (services: ContextMapperDslServices) {
911
const registry = services.validation.ValidationRegistry
1012
const validator = services.validation.ContextMapperDslValidator
11-
const checks: ValidationChecks<ContextMapperDslAstType> = {}
13+
const checks: ValidationChecks<ContextMapperDslAstType> = {
14+
ContextMappingModel: new ContextMappingModelValidator().validate,
15+
Value: new ValueValidator().validate
16+
}
1217
registry.register(checks, validator)
1318
}
1419

15-
/**
16-
* Implementation of custom validations.
17-
*/
1820
export class ContextMapperDslValidator {
1921

2022
}

0 commit comments

Comments
 (0)