@sap/cds-lsp
Advanced tools
Comparing version 6.2.0 to 6.2.2
@@ -9,2 +9,12 @@ # Changelog | ||
## 6.2.2 - 2022-10-17 | ||
### Added | ||
- cds-lsp bin script for easier integration into custom editors/IDEs | ||
### Fixed | ||
- syntax highlighting of comments | ||
### Removed | ||
- legacy custom ParseTreeCommand | ||
## 6.2.0 - 2022-09-30 | ||
@@ -11,0 +21,0 @@ |
@@ -251,2 +251,3 @@ import * as LSP from 'vscode-languageserver-protocol'; | ||
} | ||
// cds-compiler/lib/base/messages.js#severitySpecs | ||
export type CsnSeverity = "Error" | "Warning" | "Info" | "Debug"; | ||
@@ -281,3 +282,3 @@ export interface XsnParseModel extends CdsvAstNode { | ||
} | ||
export type CdsvKind = "context" | "entity" | "extend" | "element" | "namespace" | "using" | "service" | "source" | "type" | "view"; | ||
export type CdsvKind = "context" | "entity" | "extend" | "element" | "namespace" | "using" | "service" | "source" | "type" | "view"; // view is not in csn, we just need it to mark 'entity as projection' | ||
export interface CdsvParseOptions { | ||
@@ -322,5 +323,10 @@ parseOnly?: boolean; | ||
} | ||
// export const $lsp: CdsCompiler|undefined; // v2 | ||
// export function parse(source: FileContent, filename: AbsolutePath, options?: CdsvParseOptions): XsnParseModel; | ||
export interface CdsvSourceDictionary { | ||
[localPath: AbsolutePath]: FileContent; | ||
} | ||
// ------------------------------------------ | ||
// XSN | ||
// ------------------------------------------ | ||
export interface XsnArtifacts { | ||
@@ -349,2 +355,5 @@ [localName: string]: XsnArtifact; | ||
} | ||
// export interface XsnLocated { | ||
// location: XsnLocation; | ||
// } | ||
export interface XsnMessage { | ||
@@ -387,2 +396,43 @@ home?: string; | ||
} | ||
// TODO: use this: | ||
// type XsnKind = | ||
// | ||
// /* | ||
// **Artifacts**: `type`, `entity` (tables & projections), `view`, `context`, `service`, `annotation`, and `const`; | ||
// currently not fully supported are `package`, and the DCL artifacts `accesspolicy`, `role`, `aspect`. | ||
// These are found in the `definitions` property of the model, and the `artifacts` property of sources, contexts or services. | ||
// */ | ||
// 'type' | 'entity' | 'view' | 'context' | 'service' | 'annotation' | 'const' | | ||
// // 'package' | 'accesspolicy' | 'role' | 'aspect' | | ||
// | ||
// | ||
// /* | ||
// **Members**: `element` (element or select item) in the `elements` property of typed artifacts or entities (including views), | ||
// `enum` in the `enum` property of typed constructs, | ||
// `action` in the `actions` property of entities, | ||
// `key` in the `foreignKeys` property of constructs typed with a managed association, | ||
// `param` in the `params` property of actions and views. | ||
// */ | ||
// 'element' | 'enum' | 'action' | 'key' | 'param' | | ||
// | ||
// | ||
// /* | ||
// **Auxiliaries**: `source` (sub model) in the `sources` property of the model, | ||
// `using` (using declaration) in the `artifacts` property of the source, | ||
// (_TODO_: currently also in the `usings` property) | ||
// `block` (lexical CDL block) in the `blocks` property of contexts and services, | ||
// `builtin` for the builtin environment (for `cds.Integer`, …) | ||
// Future?: `alias` (entity alias in select), `ambiguity` (?, in view with joins). | ||
// */ | ||
// 'using' | 'block' | 'builtin' | | ||
// // 'alias' | 'ambiguity' | | ||
// | ||
// | ||
// /* | ||
// **Extensions**: `extend` (for the `extend` statement) or `annotate` (for the `annotate` statement) | ||
// in the `extensions` property of sources or extensions. | ||
// */ | ||
// 'extend' | 'annotate' | ||
// | ||
// ; | ||
export type XsnKind = "__i18n" | // LSP tag for tokens that are translation strings | ||
@@ -393,2 +443,3 @@ "aspect" | "using" | "entity" | "view" | // only compiler V1? | ||
"context" | "type" | "element" | "extend" | "service" | "namespace" | "builtin"; | ||
// Idea: use Discriminated Unions e.g. XsnEntity {kind: 'entity', ...}, ..., type XsnNode = XsnEntity | ... | ||
export interface XsnArtifact { | ||
@@ -548,2 +599,3 @@ doc?: XsnDocComment; | ||
export type XsnLocation = XsnLocation1 | XsnLocation2; | ||
// Compiler v1 | ||
export interface XsnLocation1 { | ||
@@ -555,2 +607,3 @@ filename: WorkspaceRelativePath; // cds-compiler v1 => use filenameOf(location) | ||
} | ||
// Compiler v2 | ||
export interface XsnLocation2 { | ||
@@ -557,0 +610,0 @@ file: WorkspaceRelativePath; // cds-compiler v2 |
@@ -474,7 +474,6 @@ import { BigIntStats, Dirent, PathLike, StatOptions, Stats, WriteFileOptions } from 'fs'; | ||
export declare type ConfigLevel = "off" | "error" | "warning" | "info" | "verbose" | "debug"; | ||
export interface TraceAspect<T> { | ||
name: T | "*"; | ||
export interface TraceComponent { | ||
name: LspTraceComponent | "*"; | ||
level: ConfigLevel; | ||
} | ||
export declare type TraceComponent = TraceAspect<LspTraceComponent>; | ||
export interface ITraceConfiguration { | ||
@@ -875,2 +874,3 @@ name?: string; | ||
} | ||
// cds-compiler/lib/base/messages.js#severitySpecs | ||
export type CsnSeverity = "Error" | "Warning" | "Info" | "Debug"; | ||
@@ -905,3 +905,3 @@ export interface XsnParseModel extends CdsvAstNode { | ||
} | ||
export type CdsvKind = "context" | "entity" | "extend" | "element" | "namespace" | "using" | "service" | "source" | "type" | "view"; | ||
export type CdsvKind = "context" | "entity" | "extend" | "element" | "namespace" | "using" | "service" | "source" | "type" | "view"; // view is not in csn, we just need it to mark 'entity as projection' | ||
export interface CdsvParseOptions { | ||
@@ -946,5 +946,10 @@ parseOnly?: boolean; | ||
} | ||
// export const $lsp: CdsCompiler|undefined; // v2 | ||
// export function parse(source: FileContent, filename: AbsolutePath, options?: CdsvParseOptions): XsnParseModel; | ||
export interface CdsvSourceDictionary { | ||
[localPath: AbsolutePath]: FileContent; | ||
} | ||
// ------------------------------------------ | ||
// XSN | ||
// ------------------------------------------ | ||
export interface XsnArtifacts { | ||
@@ -973,2 +978,5 @@ [localName: string]: XsnArtifact; | ||
} | ||
// export interface XsnLocated { | ||
// location: XsnLocation; | ||
// } | ||
export interface XsnMessage { | ||
@@ -1011,2 +1019,43 @@ home?: string; | ||
} | ||
// TODO: use this: | ||
// type XsnKind = | ||
// | ||
// /* | ||
// **Artifacts**: `type`, `entity` (tables & projections), `view`, `context`, `service`, `annotation`, and `const`; | ||
// currently not fully supported are `package`, and the DCL artifacts `accesspolicy`, `role`, `aspect`. | ||
// These are found in the `definitions` property of the model, and the `artifacts` property of sources, contexts or services. | ||
// */ | ||
// 'type' | 'entity' | 'view' | 'context' | 'service' | 'annotation' | 'const' | | ||
// // 'package' | 'accesspolicy' | 'role' | 'aspect' | | ||
// | ||
// | ||
// /* | ||
// **Members**: `element` (element or select item) in the `elements` property of typed artifacts or entities (including views), | ||
// `enum` in the `enum` property of typed constructs, | ||
// `action` in the `actions` property of entities, | ||
// `key` in the `foreignKeys` property of constructs typed with a managed association, | ||
// `param` in the `params` property of actions and views. | ||
// */ | ||
// 'element' | 'enum' | 'action' | 'key' | 'param' | | ||
// | ||
// | ||
// /* | ||
// **Auxiliaries**: `source` (sub model) in the `sources` property of the model, | ||
// `using` (using declaration) in the `artifacts` property of the source, | ||
// (_TODO_: currently also in the `usings` property) | ||
// `block` (lexical CDL block) in the `blocks` property of contexts and services, | ||
// `builtin` for the builtin environment (for `cds.Integer`, …) | ||
// Future?: `alias` (entity alias in select), `ambiguity` (?, in view with joins). | ||
// */ | ||
// 'using' | 'block' | 'builtin' | | ||
// // 'alias' | 'ambiguity' | | ||
// | ||
// | ||
// /* | ||
// **Extensions**: `extend` (for the `extend` statement) or `annotate` (for the `annotate` statement) | ||
// in the `extensions` property of sources or extensions. | ||
// */ | ||
// 'extend' | 'annotate' | ||
// | ||
// ; | ||
export type XsnKind = "__i18n" | // LSP tag for tokens that are translation strings | ||
@@ -1017,2 +1066,3 @@ "aspect" | "using" | "entity" | "view" | // only compiler V1? | ||
"context" | "type" | "element" | "extend" | "service" | "namespace" | "builtin"; | ||
// Idea: use Discriminated Unions e.g. XsnEntity {kind: 'entity', ...}, ..., type XsnNode = XsnEntity | ... | ||
export interface XsnArtifact { | ||
@@ -1172,2 +1222,3 @@ doc?: XsnDocComment; | ||
export type XsnLocation = XsnLocation1 | XsnLocation2; | ||
// Compiler v1 | ||
export interface XsnLocation1 { | ||
@@ -1179,2 +1230,3 @@ filename: WorkspaceRelativePath; // cds-compiler v1 => use filenameOf(location) | ||
} | ||
// Compiler v2 | ||
export interface XsnLocation2 { | ||
@@ -1181,0 +1233,0 @@ file: WorkspaceRelativePath; // cds-compiler v2 |
@@ -0,1 +1,3 @@ | ||
#!/usr/bin/env node | ||
"use strict"; | ||
@@ -2,0 +4,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
{ | ||
"name": "@sap/cds-lsp", | ||
"description": "Language server for CDS", | ||
"version": "6.2.0", | ||
"version": "6.2.2", | ||
"homepage": "https://cap.cloud.sap/", | ||
@@ -33,2 +33,3 @@ "author": "SAP SE (https://www.sap.com)", | ||
"bin": { | ||
"cds-lsp": "./dist/main.js", | ||
"format-cds": "./scripts/formatCli.js" | ||
@@ -35,0 +36,0 @@ }, |
@@ -651,21 +651,4 @@ { | ||
{ | ||
"begin": "(^[ \\t]+)?(?=//)", | ||
"beginCaptures": { | ||
"1": { | ||
"name": "punctuation.whitespace.comment.leading.cds" | ||
} | ||
}, | ||
"end": "(?!\\G)", | ||
"patterns": [ | ||
{ | ||
"begin": "//", | ||
"beginCaptures": { | ||
"0": { | ||
"name": "punctuation.definition.comment.cds" | ||
} | ||
}, | ||
"end": "\\n", | ||
"name": "comment.line.double-slash.cds" | ||
} | ||
] | ||
"match": "//.*", | ||
"name": "comment.line.double-slash.cds" | ||
} | ||
@@ -883,2 +866,5 @@ ] | ||
{ | ||
"include": "#bracedElementDef" | ||
}, | ||
{ | ||
"include": "#strings" | ||
@@ -898,4 +884,14 @@ }, | ||
"comment": "Element name or type", | ||
"match": "\\S+(?=\\s*[:{])", | ||
"name": "entity.name.type.attribute-name.cds" | ||
"begin": "([$_a-zA-Z][$_a-zA-Z0-9]*|\"[^\"]*(\"\"[^\"]*)*\"|!\\[[^\\]]*(\\]\\][^\\]]*)*\\])(?=\\s*[:{,])", | ||
"beginCaptures": { | ||
"1": { | ||
"name": "entity.name.type.attribute-name.cds" | ||
} | ||
}, | ||
"end": "(,)|(?=\\s*[:{])", | ||
"endCaptures": { | ||
"1": { | ||
"name": "punctuation.separator.object.cds" | ||
} | ||
} | ||
}, | ||
@@ -906,5 +902,2 @@ { | ||
{ | ||
"include": "#typeStruct" | ||
}, | ||
{ | ||
"include": "#operators" | ||
@@ -920,23 +913,4 @@ }, | ||
}, | ||
"typeStruct": { | ||
"begin": "{", | ||
"beginCaptures": { | ||
"0": { | ||
"name": "punctuation.section.scope.begin.cds" | ||
} | ||
}, | ||
"end": "}", | ||
"endCaptures": { | ||
"0": { | ||
"name": "punctuation.section.scope.end.cds" | ||
} | ||
}, | ||
"patterns": [ | ||
{ | ||
"include": "#elementDef" | ||
} | ||
] | ||
}, | ||
"bracedElementDef": { | ||
"comment": "Braces enclosing all elementDef-s - TODO why can't we include elementDef 1 level up?", | ||
"comment": "Braces enclosing all elementDefs; also typeStructs", | ||
"begin": "{", | ||
@@ -956,2 +930,5 @@ "beginCaptures": { | ||
{ | ||
"include": "#comments" | ||
}, | ||
{ | ||
"include": "#elementDef" | ||
@@ -958,0 +935,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1953435
6645