Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: SonarCloud Analysis
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarqube:
name: SonarQube
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Binary file modified .yarn/install-state.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions langium-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ This folder contains all necessary files for your language extension.
* `src/extension/main.ts` - the main code of the extension, which is responsible for launching a language server and client.
* `src/language/context-mapper-dsl.langium` - the grammar definition of your language.
* `src/language/main.ts` - the entry point of the language server process.
* `src/language/context-mapper-dsl-module.ts` - the dependency injection module of your language implementation. Use this to register overridden and added services.
* `src/language/context-mapper-dsl-validator.ts` - an example validator. You should change it to reflect the semantics of your language.
* `src/language/ContextMapperDslModule.ts` - the dependency injection module of your language implementation. Use this to register overridden and added services.
* `src/language/ContextMapperDslValidator.ts` - an example validator. You should change it to reflect the semantics of your language.
* `src/cli/main.ts` - the entry point of the command line interface (CLI) of your language.
* `src/cli/generator.ts` - the code generator used by the CLI to write output files from DSL documents.
* `src/cli/cli-util.ts` - utility code for the CLI.
Expand Down
14 changes: 14 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sonar.projectKey=lstreckeisen_context-mapper-language-server
sonar.organization=lstreckeisen


# This is the name and version displayed in the SonarCloud UI.
#sonar.projectName=context-mapper-language-server
#sonar.projectVersion=1.0


# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
#sonar.sources=.

# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
type PartialLangiumServices
} from 'langium/lsp'
import { ContextMapperDslGeneratedModule, ContextMapperDslGeneratedSharedModule } from './generated/module.js'
import { ContextMapperDslValidator, registerValidationChecks } from './context-mapper-dsl-validator.js'
import { ContextMapperDslValidator, registerValidationChecks } from './ContextMapperDslValidator.js'
import { ContextMapperDslSemanticTokenProvider } from './semantictokens/ContextMapperDslSemanticTokenProvider.js'

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import type { ValidationChecks } from 'langium'
import type { ContextMapperDslAstType } from './generated/ast.js'
import type { ContextMapperDslServices } from './context-mapper-dsl-module.js'
import type { ContextMapperDslServices } from './ContextMapperDslModule.js'
import { ContextMappingModelValidator } from './validation/ContextMappingModelValidator.js'
import { ValueValidator } from './validation/ValueValidator.js'

/**
* Register custom validation checks.
*/
export function registerValidationChecks (services: ContextMapperDslServices) {
const registry = services.validation.ValidationRegistry
const validator = services.validation.ContextMapperDslValidator
const checks: ValidationChecks<ContextMapperDslAstType> = {}
const checks: ValidationChecks<ContextMapperDslAstType> = {
ContextMappingModel: new ContextMappingModelValidator().validate,
Value: new ValueValidator().validate
}
registry.register(checks, validator)
}

/**
* Implementation of custom validations.
*/
export class ContextMapperDslValidator {

}
Loading