@sap/cds-lsp
Advanced tools
Comparing version 7.4.0 to 7.5.0
@@ -9,3 +9,14 @@ # Changelog | ||
## 7.5.0 - 2023-12-20 | ||
### Added | ||
- unused imports are reported as warning and grayed out incl. quickfix to remove them | ||
- snippet proposals for artifact elements in an `annotate` statement | ||
- new user setting `cds.contributions.enablement.additionalAnalyticalAnnotations` (default: off) to get | ||
annotation support for analytical queries (experimental) | ||
### Fixed | ||
- padding and highlighting of identifiers with Unicode characters | ||
- highlighting of `stored` keyword | ||
## 7.4.0 - 2023-11-16 | ||
@@ -30,3 +41,3 @@ | ||
## Removed | ||
### Removed | ||
- workspace validation modes `OpenEditorsAndDirectSources` and | ||
@@ -38,3 +49,3 @@ `OpenEditorsDirectSourcesAndDirectDependencies` are no longer supported. | ||
## Added | ||
### Added | ||
- (Experimental): `cds-lsp` can now be used in-process. `ServerStarted.start` method has | ||
@@ -307,3 +318,3 @@ new optional `options` parameter which allows to use any | ||
## Fixed | ||
### Fixed | ||
- fixed glitches in cds schema support for `package.json`, `.cdsrc.json` and `.cdsrc-private.json` | ||
@@ -310,0 +321,0 @@ - fixed highlighting for empty block comments `/**/` |
@@ -0,1 +1,3 @@ | ||
import * as LSP from 'vscode-languageserver-protocol'; | ||
@@ -7,2 +9,3 @@ | ||
export type FileContent = string; | ||
export type UsingPath = string; | ||
export type Kind = "context" | "service" | "namespace" | "entity" | "event" | "view" | "type" | "annotation" | "annotate" | "action" | "function" | "const" | "role" | "aspect" | "accesspolicy" | "mixin" | "element" | "query" | "param" | "enum" | "source" | "using" | "extend" | "qualifiedAnnotation"; | ||
@@ -31,6 +34,6 @@ export interface Thing { | ||
} | ||
export interface WithLocation { | ||
export interface WithXsnLocation { | ||
location: XsnLocation; | ||
} | ||
export interface CdsvArtifact extends WithLocation { | ||
export interface CdsvArtifact extends WithXsnLocation { | ||
kind: CdsvKind; | ||
@@ -175,2 +178,3 @@ name: CdsvDefinitionName; | ||
getImplicitNamespaceNameLocation(thing: any): any; | ||
usingsOf(source: XsnSource): XsnArtifactUsing[]; | ||
} | ||
@@ -331,5 +335,5 @@ export interface XsnCompileModel { | ||
kind: "using"; | ||
fileDep?: XsnFileDependency; | ||
annotationAssignments: XsnAnnotationAssignment[]; | ||
extern?: { | ||
extern: { | ||
id: FullyQualifiedName; | ||
location: XsnLocation; | ||
@@ -340,2 +344,3 @@ path: XsnPathSegment[]; | ||
name: XsnName; | ||
fileDep?: XsnFileDependency; | ||
usings?: XsnArtifactUsing[]; | ||
@@ -392,4 +397,20 @@ } | ||
onDirectDependenciesFound(absoluteLocalPath: AbsolutePath, dependentAbsoluteLocalPaths: AbsolutePath[]): void; | ||
onUsingStatementFound(absoluteLocalPath: AbsolutePath, extractor: IXsnUsingExtraction): void; | ||
needsExtraction(sourcePath: AbsolutePath): boolean; | ||
} | ||
export interface IXsnUsingExtraction { | ||
getUsingLocation(): XsnLocation; | ||
getTargetFilePath(): AbsolutePath | WorkspaceRelativePath | undefined; | ||
getTargetImportPath(): UsingPath | undefined; | ||
getImportedItems(): IXsnImportedItem[]; | ||
} | ||
export interface IXsnImportedItem { | ||
getItemImportLocation(): XsnLocation; | ||
getAbsoluteName(): FullyQualifiedName; | ||
getLocalName(): string; | ||
isWrappedInBraces(): boolean; | ||
getAbsoluteNameLocation(): XsnLocation; | ||
getLocalNameLocation(): XsnLocation; | ||
getTargetFilePath(): WorkspaceRelativePath | undefined; | ||
} | ||
export interface IXsnExtractionEvent { | ||
@@ -421,2 +442,5 @@ consumed: boolean; | ||
readonly location: LSP.Location; | ||
readonly start: LSP.Position; | ||
readonly end: LSP.Position; | ||
isIdentifier(): boolean; | ||
compare(position: LSP.Position): number; | ||
@@ -449,2 +473,3 @@ } | ||
isExtend?: boolean; | ||
isAspect?: boolean; | ||
} | ||
@@ -462,3 +487,4 @@ export interface IBlitzIndex { | ||
MarkMissingTranslations = "cds.compiler.markMissingI18nDefault", | ||
OmitRedundantTypesInSnippets = "cds.completion.annotations.omitRedundantTypesInSnippets" | ||
OmitRedundantTypesInSnippets = "cds.completion.annotations.omitRedundantTypesInSnippets", | ||
EnableAdditionalAnalyticalAnnotations = "cds.contributions.enablement.additionalAnalyticalAnnotations" | ||
} | ||
@@ -465,0 +491,0 @@ export interface Translation { |
@@ -0,1 +1,3 @@ | ||
import { BigIntStats, Dirent, PathLike, StatOptions, Stats, WriteFileOptions } from 'fs'; | ||
@@ -12,2 +14,3 @@ import { TypedEmitter } from 'tiny-typed-emitter'; | ||
export type FileContent = string; | ||
export type UsingPath = string; | ||
export type Kind = "context" | "service" | "namespace" | "entity" | "event" | "view" | "type" | "annotation" | "annotate" | "action" | "function" | "const" | "role" | "aspect" | "accesspolicy" | "mixin" | "element" | "query" | "param" | "enum" | "source" | "using" | "extend" | "qualifiedAnnotation"; | ||
@@ -36,6 +39,6 @@ export interface Thing { | ||
} | ||
export interface WithLocation { | ||
export interface WithXsnLocation { | ||
location: XsnLocation; | ||
} | ||
export interface CdsvArtifact extends WithLocation { | ||
export interface CdsvArtifact extends WithXsnLocation { | ||
kind: CdsvKind; | ||
@@ -152,2 +155,3 @@ name: CdsvDefinitionName; | ||
getImplicitNamespaceNameLocation(thing: any): any; | ||
usingsOf(source: XsnSource): XsnArtifactUsing[]; | ||
} | ||
@@ -308,5 +312,5 @@ export interface XsnCompileModel { | ||
kind: "using"; | ||
fileDep?: XsnFileDependency; | ||
annotationAssignments: XsnAnnotationAssignment[]; | ||
extern?: { | ||
extern: { | ||
id: FullyQualifiedName; | ||
location: XsnLocation; | ||
@@ -317,2 +321,3 @@ path: XsnPathSegment[]; | ||
name: XsnName; | ||
fileDep?: XsnFileDependency; | ||
usings?: XsnArtifactUsing[]; | ||
@@ -365,4 +370,20 @@ } | ||
onDirectDependenciesFound(absoluteLocalPath: AbsolutePath, dependentAbsoluteLocalPaths: AbsolutePath[]): void; | ||
onUsingStatementFound(absoluteLocalPath: AbsolutePath, extractor: IXsnUsingExtraction): void; | ||
needsExtraction(sourcePath: AbsolutePath): boolean; | ||
} | ||
export interface IXsnUsingExtraction { | ||
getUsingLocation(): XsnLocation; | ||
getTargetFilePath(): AbsolutePath | WorkspaceRelativePath | undefined; | ||
getTargetImportPath(): UsingPath | undefined; | ||
getImportedItems(): IXsnImportedItem[]; | ||
} | ||
export interface IXsnImportedItem { | ||
getItemImportLocation(): XsnLocation; | ||
getAbsoluteName(): FullyQualifiedName; | ||
getLocalName(): string; | ||
isWrappedInBraces(): boolean; | ||
getAbsoluteNameLocation(): XsnLocation; | ||
getLocalNameLocation(): XsnLocation; | ||
getTargetFilePath(): WorkspaceRelativePath | undefined; | ||
} | ||
export interface IXsnExtractionEvent { | ||
@@ -393,2 +414,5 @@ consumed: boolean; | ||
readonly location: LSP.Location; | ||
readonly start: LSP.Position; | ||
readonly end: LSP.Position; | ||
isIdentifier(): boolean; | ||
compare(position: LSP.Position): number; | ||
@@ -421,2 +445,3 @@ } | ||
isExtend?: boolean; | ||
isAspect?: boolean; | ||
} | ||
@@ -434,3 +459,4 @@ export interface IBlitzIndex { | ||
MarkMissingTranslations = "cds.compiler.markMissingI18nDefault", | ||
OmitRedundantTypesInSnippets = "cds.completion.annotations.omitRedundantTypesInSnippets" | ||
OmitRedundantTypesInSnippets = "cds.completion.annotations.omitRedundantTypesInSnippets", | ||
EnableAdditionalAnalyticalAnnotations = "cds.contributions.enablement.additionalAnalyticalAnnotations" | ||
} | ||
@@ -559,2 +585,3 @@ export interface Translation { | ||
"actionFunctionMainDef", | ||
"annotateArtifactElements", | ||
"annotateElement", | ||
@@ -618,10 +645,11 @@ "annotationAssignment_atn", | ||
export type TokenCategory = "Identifier" | "Keyword" | "Operator" | "String" | "number" | "Number" | "Comment" | "LineComment" | "DocComment" | "<EOF>" | "<???>"; | ||
export type IdentifierCategory = "Namespace" | "Using" | "global" | "Context" | "Service" | "Type" | "Enum" | "Entity" | "Extend" | "Element" | "Action" | "BoundAction" | "Param" | "paramname" | "Event" | "AnnoDef" | "Annotate" | "anno" | "name" | "variant" | "artref" | "ref" | "FromAlias" | "Item" | "Mixin" | "Key" | "enumref"; | ||
export type RelativeToCursor = "tokenAfterCursor" | "tokenStartsAtCursor" | "tokenContainsCursor" | "tokenEndsWithCursor" | "tokenBeforeCursor"; | ||
export interface IToken extends LSP.Range, LSP.Position { | ||
readonly category: TokenCategory; | ||
text: string; | ||
readonly originalText: string; | ||
startOffset: number; | ||
readonly endOffset: number; | ||
readonly category: TokenCategory; | ||
line: number; | ||
character: number; | ||
text: string; | ||
readonly endLine: number; | ||
@@ -631,8 +659,6 @@ readonly endCharacter: number; | ||
readonly startTokenIndex: number; | ||
readonly start: LSP.Position; | ||
readonly end: LSP.Position; | ||
readonly start: LSP.Position; | ||
startOffset: number; | ||
originalText: string; | ||
ejected: boolean; | ||
readonly identifierCategory?: IdentifierCategory; | ||
data: unknown; | ||
id: string; | ||
@@ -931,2 +957,3 @@ isIdentifier(): boolean; | ||
CONTRIBUTIONS_REGISTRY = "cds.contributions.registry", | ||
CONTRIBUTIONS_ANALYTICS_ENABLED = "cds.contributions.enablement.additionalAnalyticalAnnotations", | ||
CONTRIBUTIONS_ODATA_ENABLED = "cds.contributions.enablement.odata", | ||
@@ -1099,2 +1126,3 @@ CONTRIBUTIONS_LONGRUN_DETECT = "cds.contributions.enablement.longRunning.detect", | ||
IMPORT_ARTIFACT = "import-artifact", | ||
REMOVE_UNUSED_IMPORT = "remove-unused-import", | ||
MAINTAIN_TRANSLATION = "maintain-translation", | ||
@@ -1157,2 +1185,3 @@ MIGRATE_TO_DOCCOMMENT = "migrate-to-doccomment", | ||
}; | ||
getDiagnostics(uri: Uri): LSP.Diagnostic[]; | ||
} | ||
@@ -1287,4 +1316,5 @@ export interface _ILanguageServer { | ||
rmdirSync(p: PathLike): void; | ||
readdirSync(path: PathLike, withFileTypes?: false | undefined): string[]; | ||
readdirSync(path: PathLike, withFileTypes?: false): string[]; | ||
readdirSync(path: PathLike, withFileTypes: true): Dirent[]; | ||
readdirSync(path: PathLike, withFileTypes?: boolean): string[] | Dirent[]; | ||
statSync(p: PathLike): Stats; | ||
@@ -1303,9 +1333,14 @@ realpathSync(p: PathLike): AbsolutePath; | ||
} | ||
export type UsingStatistics = { | ||
[key: string]: { | ||
name: string; | ||
referenceCount: number; | ||
ranges: Range[]; | ||
export interface ImportedItem { | ||
statementId: number; | ||
absoluteName: FullyQualifiedName; | ||
localName: string; | ||
localImportLocation: LSP.Range; | ||
from: { | ||
statementRange?: LSP.Range; | ||
targetUri?: Uri; | ||
targetImportPath?: UsingPath; | ||
}; | ||
}; | ||
references: IToken[]; | ||
} | ||
export interface TokenLike { | ||
@@ -1318,3 +1353,3 @@ text: string; | ||
export interface _IFileIndex extends IFileIndex { | ||
usingStatistics: UsingStatistics; | ||
usingStatistics: ImportedItem[]; | ||
compilerVersion: string; | ||
@@ -1321,0 +1356,0 @@ compilerMessages: LSP.Diagnostic[]; |
{ | ||
"name": "@sap/cds-lsp", | ||
"version": "7.4.0", | ||
"version": "7.5.0", | ||
"lockfileVersion": 3, | ||
@@ -9,8 +9,8 @@ "requires": true, | ||
"name": "@sap/cds-lsp", | ||
"version": "7.4.0", | ||
"version": "7.5.0", | ||
"dependencies": { | ||
"@sap/cds-compiler": "4.4.0", | ||
"ignore": "5.2.4", | ||
"@sap/cds-compiler": "4.5.0", | ||
"ignore": "5.3.0", | ||
"json-source-map": "0.6.1", | ||
"marked": "10.0.0", | ||
"marked": "11.1.0", | ||
"tiny-typed-emitter": "2.1.0", | ||
@@ -23,3 +23,3 @@ "vscode-languageserver": "9.0.1", | ||
"node_modules/@sap/cds-compiler": { | ||
"version": "4.4.0", | ||
"version": "4.5.0", | ||
"dependencies": { | ||
@@ -44,3 +44,3 @@ "antlr4": "4.9.3" | ||
"node_modules/ignore": { | ||
"version": "5.2.4", | ||
"version": "5.3.0", | ||
"engines": { | ||
@@ -54,3 +54,3 @@ "node": ">= 4" | ||
"node_modules/marked": { | ||
"version": "10.0.0", | ||
"version": "11.1.0", | ||
"bin": { | ||
@@ -57,0 +57,0 @@ "marked": "bin/marked.js" |
{ | ||
"name": "@sap/cds-lsp", | ||
"description": "Language server for CDS", | ||
"version": "7.4.0", | ||
"version": "7.5.0", | ||
"homepage": "https://cap.cloud.sap/", | ||
@@ -39,6 +39,6 @@ "author": "SAP SE (https://www.sap.com)", | ||
"dependencies": { | ||
"@sap/cds-compiler": "4.4.0", | ||
"ignore": "5.2.4", | ||
"@sap/cds-compiler": "4.5.0", | ||
"ignore": "5.3.0", | ||
"json-source-map": "0.6.1", | ||
"marked": "10.0.0", | ||
"marked": "11.1.0", | ||
"tiny-typed-emitter": "2.1.0", | ||
@@ -45,0 +45,0 @@ "vscode-languageserver": "9.0.1", |
@@ -78,3 +78,3 @@ { | ||
"comment": "(default|name) as alias", | ||
"match": "(?:\\b(default)\\b|\\b([$_a-zA-Z][$_a-zA-Z0-9]*)\\b)\\s*(\\bas\\b)\\s*(?:\\b([$_a-zA-Z][$_a-zA-Z0-9]*)\\b)" | ||
"match": "(?:\\b(default)\\b|\\b([$_\\p{ID_Start}][$\\p{ID_Continue}\\u200C\\u200D]*)\\b)\\s*(\\bas\\b)\\s*(?:\\b([$_\\p{ID_Start}][$\\p{ID_Continue}\\u200C\\u200D]*)\\b)" | ||
}, | ||
@@ -89,3 +89,3 @@ { | ||
{ | ||
"match": "\\b([$_a-zA-Z][$_a-zA-Z0-9]*)\\b", | ||
"match": "\\b([$_\\p{ID_Start}][$\\p{ID_Continue}\\u200C\\u200D]*)\\b", | ||
"name": "entity.name.type.cds" | ||
@@ -132,3 +132,3 @@ } | ||
{ | ||
"match": "\\b([$_a-zA-Z][$_a-zA-Z0-9]*)\\b(?=.*\\bfrom\\b)", | ||
"match": "\\b([$_\\p{ID_Start}][$\\p{ID_Continue}\\u200C\\u200D]*)\\b(?=.*\\bfrom\\b)", | ||
"name": "entity.name.type.cds" | ||
@@ -155,7 +155,7 @@ }, | ||
"comment": "ES6 export: `export default (variable|class, etc.)`", | ||
"match": "(?i)\\b(export)\\b\\s*\\b(default)\\b(?:\\s*)\\b((?!\\bclass\\b|\\blet\\b|\\bvar\\b|\\bconst\\b)[$_a-z][$_a-z0-9]*)?\\b", | ||
"match": "(?i)\\b(export)\\b\\s*\\b(default)\\b(?:\\s*)\\b((?!\\bclass\\b|\\blet\\b|\\bvar\\b|\\bconst\\b)[$_\\p{ID_Start}][$\\p{ID_Continue}\\u200C\\u200D]*)?\\b", | ||
"name": "meta.export.cds" | ||
}, | ||
{ | ||
"begin": "(?i)\\b(action|function)\\s+([$_a-z][$_a-z0-9]*)\\s*(\\()", | ||
"begin": "(?i)\\b(action|function)\\s+([$_\\p{ID_Start}][$\\p{ID_Continue}\\u200C\\u200D]*)\\s*(\\()", | ||
"beginCaptures": { | ||
@@ -199,3 +199,3 @@ "1": { | ||
}, | ||
"match": "\\b(class)(?:\\s+([$_a-zA-Z][$_a-zA-Z0-9]*))?(?:\\s+(extends)\\s+([$_a-zA-Z][$_a-zA-Z0-9]*))?\\s*($|(?={))", | ||
"match": "\\b(class)(?:\\s+([$_\\p{ID_Start}][$\\p{ID_Continue}\\u200C\\u200D]*))?(?:\\s+(extends)\\s+([$_\\p{ID_Start}][$\\p{ID_Continue}\\u200C\\u200D]*))?\\s*($|(?={))", | ||
"name": "meta.class.cds" | ||
@@ -291,3 +291,3 @@ }, | ||
"comment": "Match classes based on the usage of the \"new\" operator.", | ||
"match": "(?<=new )([$_a-zA-Z][$_a-zA-Z0-9]*)(?!\\w)", | ||
"match": "(?<=new )([$_\\p{ID_Start}][$\\p{ID_Continue}\\u200C\\u200D]*)(?!\\w)", | ||
"name": "support.class.cds" | ||
@@ -297,3 +297,3 @@ }, | ||
"comment": "Match classes based on the usage of the \"instanceof\" operator.", | ||
"match": "(?<= instanceof )([$_a-zA-Z][$_a-zA-Z0-9]*)(?!\\w)", | ||
"match": "(?<= instanceof )([$_\\p{ID_Start}][$\\p{ID_Continue}\\u200C\\u200D]*)(?!\\w)", | ||
"name": "support.class.cds" | ||
@@ -303,3 +303,3 @@ }, | ||
"comment": "Match classes based on the usage of the \"prototype\" property.", | ||
"match": "(?<!\\w)([$_a-zA-Z][$_a-zA-Z0-9]*)(?=\\.prototype\\b)", | ||
"match": "(?<!\\w)([$_\\p{ID_Start}][$\\p{ID_Continue}\\u200C\\u200D]*)(?=\\.prototype\\b)", | ||
"name": "support.class.cds" | ||
@@ -339,6 +339,7 @@ }, | ||
"keyword": { | ||
"name": "keyword", | ||
"patterns": [ | ||
{ | ||
"comment": "Association, Composition", | ||
"match": "(?<!\\.|\\$)\\b(Association\\b\\s*(?:\\[[0-9.eE+, *-]*\\]\\s*)?to\\b\\s*(?:many\\s*|one\\s*)?|Composition\\b\\s*(?:\\[[0-9.eE+, *-]*\\]\\s*)?of\\b\\s*(?:many\\s*|one\\s*)?)(?:(?=\\s*{)|([$_a-zA-Z][$_a-zA-Z0-9]*|\"[^\"]*(?:\"\"[^\"]*)*\"|!\\[[^\\]]*(?:\\]\\][^\\]]*)*\\]))", | ||
"match": "(?<!\\.|\\$)\\b(Association\\b\\s*(?:\\[[0-9.eE+, *-]*\\]\\s*)?to\\b\\s*(?:many\\s*|one\\s*)?|Composition\\b\\s*(?:\\[[0-9.eE+, *-]*\\]\\s*)?of\\b\\s*(?:many\\s*|one\\s*)?)(?:(?=\\s*{)|(\"[^\"]*(?:\"\"[^\"]*)*\"|!\\[[^\\]]*(?:\\]\\][^\\]]*)*\\]|[$_\\p{ID_Start}][$\\p{ID_Continue}\\u200C\\u200D]*))", | ||
"captures": { | ||
@@ -360,3 +361,3 @@ "1": { | ||
"comment": "CQL keywords (arbitrary casing)", | ||
"match": "(?i)(?<!\\.|\\$)\\b(all|and|any|asc|between|by|case|cast|cross|desc|distinct|element|elements|escape|except|excluding|exists|first|from|full|group|group by|having|in|inner|intersect|into|is|join|last|left|like|limit|many|minus|mixin|not null|not|null|nulls|offset|one|or|order by|outer|redirected to|select|some|top|type of|union|where|with)\\b(?!\\$|\\s*:)", | ||
"match": "(?i)(?<!\\.|\\$)\\b(all|and|any|asc|between|by|case|cast|cross|desc|distinct|element|elements|escape|except|excluding|exists|first|from|full|group|group by|having|in|inner|intersect|into|is|join|last|left|like|limit|many|minus|mixin|not null|not|null|nulls|offset|one|or|order by|outer|redirected to|select|some|stored|top|type of|union|where|with)\\b(?!\\$|\\s*:)", | ||
"name": "keyword.cds" | ||
@@ -382,5 +383,6 @@ }, | ||
"identifier": { | ||
"name": "identifier", | ||
"patterns": [ | ||
{ | ||
"match": "(?i)(?<!@)(?:\\$?\\b[_a-z][$_a-z0-9]*|\"[^\"]*(?:\"\"[^\"]*)*\"|!\\[[^\\]]*(?:\\]\\][^\\]]*)*\\])", | ||
"match": "(?i)(?<!@)(?:\"[^\"]*(?:\"\"[^\"]*)*\"|!\\[[^\\]]*(?:\\]\\][^\\]]*)*\\]|[$_\\p{ID_Start}][$\\p{ID_Continue}\\u200C\\u200D]*)", | ||
"name": "entity.name.type.cds" | ||
@@ -391,2 +393,3 @@ } | ||
"comment": { | ||
"name": "comment", | ||
"patterns": [ | ||
@@ -430,5 +433,6 @@ { | ||
"function-params": { | ||
"name": "function-params", | ||
"patterns": [ | ||
{ | ||
"match": "\\$?\\b[_a-zA-Z][$_a-zA-Z0-9]*|\"[^\"]*(?:\"\"[^\"]*)*\"|!\\[[^\\]]*(?:\\]\\][^\\]]*)*\\]", | ||
"match": "\"[^\"]*(?:\"\"[^\"]*)*\"|!\\[[^\\]]*(?:\\]\\][^\\]]*)*\\]|[$_\\p{ID_Start}][$\\p{ID_Continue}\\u200C\\u200D]*", | ||
"name": "variable.parameter.function.cds" | ||
@@ -449,2 +453,3 @@ }, | ||
"number": { | ||
"name": "number", | ||
"patterns": [ | ||
@@ -470,2 +475,3 @@ { | ||
"operator": { | ||
"name": "operator", | ||
"patterns": [ | ||
@@ -511,2 +517,3 @@ { | ||
"string": { | ||
"name": "string", | ||
"patterns": [ | ||
@@ -600,3 +607,3 @@ { | ||
"comment": "Element name or type", | ||
"match": "(?<!@)(?:\\$?\\b[_a-zA-Z][$_a-zA-Z0-9]*|\"[^\"]*(?:\"\"[^\"]*)*\"|!\\[[^\\]]*(?:\\]\\][^\\]]*)*\\])", | ||
"match": "(?<!@)(?:\"[^\"]*(?:\"\"[^\"]*)*\"|!\\[[^\\]]*(?:\\]\\][^\\]]*)*\\]|[$_\\p{ID_Start}][$\\p{ID_Continue}\\u200C\\u200D]*)", | ||
"name": "entity.other.attribute-name.cds" | ||
@@ -662,3 +669,3 @@ }, | ||
"comment": "Element name or type", | ||
"match": "(?<!@)(?:\\$?\\b[_a-zA-Z][$_a-zA-Z0-9]*|\"[^\"]*(?:\"\"[^\"]*)*\"|!\\[[^\\]]*(?:\\]\\][^\\]]*)*\\])(?=\\s*[:{,@])", | ||
"match": "(?<!@)(?:\"[^\"]*(?:\"\"[^\"]*)*\"|!\\[[^\\]]*(?:\\]\\][^\\]]*)*\\]|[$_\\p{ID_Start}][$\\p{ID_Continue}\\u200C\\u200D]*)(?=\\s*[:{,@])", | ||
"name": "entity.other.attribute-name.cds" | ||
@@ -668,3 +675,3 @@ }, | ||
"comment": "Whole-line element name", | ||
"match": "^\\s*([$_a-zA-Z][$_a-zA-Z0-9]*|\"[^\"]*(?:\"\"[^\"]*)*\"|!\\[[^\\]]*(?:\\]\\][^\\]]*)*\\])\\s*$", | ||
"match": "^\\s*(\"[^\"]*(?:\"\"[^\"]*)*\"|!\\[[^\\]]*(?:\\]\\][^\\]]*)*\\]|[$_\\p{ID_Start}][$\\p{ID_Continue}\\u200C\\u200D]*)\\s*$", | ||
"captures": { | ||
@@ -758,2 +765,3 @@ "1": { | ||
"extendElement": { | ||
"name": "extendElement", | ||
"begin": "\\b(?=extend\\b.*\\bwith\\b)", | ||
@@ -789,3 +797,3 @@ "end": "(?<=})(;)?|(;)", | ||
{ | ||
"match": "(?<!@)(?:\\$?\\b[_a-zA-Z][$_a-zA-Z0-9]*|\"[^\"]*(?:\"\"[^\"]*)*\"|!\\[[^\\]]*(?:\\]\\][^\\]]*)*\\])", | ||
"match": "(?<!@)(?:\"[^\"]*(?:\"\"[^\"]*)*\"|!\\[[^\\]]*(?:\\]\\][^\\]]*)*\\]|[$_\\p{ID_Start}][$\\p{ID_Continue}\\u200C\\u200D]*)", | ||
"name": "entity.other.attribute-name.cds" | ||
@@ -853,2 +861,3 @@ }, | ||
"atAnnoParen": { | ||
"name": "atAnnoParen", | ||
"begin": "(@)\\s*(\\()", | ||
@@ -905,5 +914,6 @@ "beginCaptures": { | ||
"atAnnoNoParen": { | ||
"name": "atAnnoNoParen", | ||
"begin": "(@)(?!\\s*\\()", | ||
"comment": "'end' uses lookahead, since end of annotation value itself cannot be safely determined currently", | ||
"end": "(?<=[}\\]'`])(?=\\s*($|[@;]))|(?<![@:])(?!\\s*:)(?=$|[\\s@,;(){}\\[\\]'`/\"!]|\\b[$_a-zA-Z])", | ||
"comment": "'end' uses lookahead, since end of annotation value itself cannot currently be safely determined", | ||
"end": "(?<=[}\\]'`])(?=\\s*($|[@;]))|(?<![@:])(?!\\s*:)(?=$|[\\s@,;(){}\\[\\]'`/\"!]|\\b\\p{ID_Start})", | ||
"captures": { | ||
@@ -946,2 +956,3 @@ "1": { | ||
"atAnnoName": { | ||
"name": "atAnnoName", | ||
"begin": "(@)", | ||
@@ -953,3 +964,3 @@ "beginCaptures": { | ||
}, | ||
"end": "(?:(?<=[$\"\\]])(?=\\s*[@:;])|(?<=[_a-zA-Z0-9])\\b)(?![#.])", | ||
"end": "(?:(?<=[$\"\\]])(?=\\s*[@:;])|(?<=\\p{ID_Continue})\\b)(?![#.])", | ||
"comment": "!TODO alternative end: (?=\\s*(?:$|[@,;:)]))", | ||
@@ -964,8 +975,9 @@ "patterns": [ | ||
"annotationName": { | ||
"name": "annotationName", | ||
"comment": "annotationPath ( '#' annotationPathVariant ) ?", | ||
"begin": "(?=[$_\"!a-zA-Z0-9])", | ||
"end": "(?:(?<=[$\"\\]])(?=\\s*[@:;])|(?<=[_a-zA-Z0-9])\\b)(?!\\s*[#.])", | ||
"begin": "(?=[\"\\p{ID_Start}]|!\\[)", | ||
"end": "(?:(?<=[$\"\\]])(?=\\s*[@:;])|(?<=\\p{ID_Continue})\\b)(?!\\s*[#.])", | ||
"patterns": [ | ||
{ | ||
"match": "[$_a-zA-Z][$_a-zA-Z0-9]*|\"[^\"]*(?:\"\"[^\"]*)*\"|!\\[[^\\]]*(?:\\]\\][^\\]]*)*\\]", | ||
"match": "\"[^\"]*(?:\"\"[^\"]*)*\"|!\\[[^\\]]*(?:\\]\\][^\\]]*)*\\]|[$_\\p{ID_Start}][$\\p{ID_Continue}\\u200C\\u200D]*", | ||
"name": "entity.name.tag.cds" | ||
@@ -996,2 +1008,3 @@ }, | ||
"optColonAndStructure": { | ||
"name": "optColonAndStructure", | ||
"begin": "(:)?\\s*({)", | ||
@@ -1052,2 +1065,3 @@ "beginCaptures": { | ||
"optColonAndArray": { | ||
"name": "optColonAndArray", | ||
"begin": "(:)?\\s*(\\[)", | ||
@@ -1110,2 +1124,3 @@ "beginCaptures": { | ||
"colonAndNumber": { | ||
"name": "colonAndNumber", | ||
"begin": "(:)\\s*(?=[0-9+-])", | ||
@@ -1128,2 +1143,3 @@ "end": "(?<=[\\h0-9])\\b", | ||
"colonAndString": { | ||
"name": "colonAndString", | ||
"begin": "(:)\\s*(x|date|time(?:stamp)?)?\\s*(')", | ||
@@ -1162,2 +1178,3 @@ "beginCaptures": { | ||
"colonAndTemplateString": { | ||
"name": "colonAndTemplateString", | ||
"begin": "(:)\\s*(?=`)", | ||
@@ -1180,3 +1197,4 @@ "end": "(?<=`)", | ||
"colonAndHashIdent": { | ||
"match": "(:)\\s*(#)\\s*([$_a-zA-Z][$_a-zA-Z0-9]*|\"[^\"]*(?:\"\"[^\"]*)*\"|!\\[[^\\]]*(?:\\]\\][^\\]]*)*\\])", | ||
"name": "colonAndHashIdent", | ||
"match": "(:)\\s*(#)\\s*(\"[^\"]*(?:\"\"[^\"]*)*\"|!\\[[^\\]]*(?:\\]\\][^\\]]*)*\\]|[$_\\p{ID_Start}][$\\p{ID_Continue}\\u200C\\u200D]*)", | ||
"captures": { | ||
@@ -1200,2 +1218,3 @@ "1": { | ||
"colonAndConstant": { | ||
"name": "colonAndConstant", | ||
"match": "(?i)(:)\\s*(null|true|false)\\b", | ||
@@ -1218,2 +1237,3 @@ "captures": { | ||
"literalValue": { | ||
"name": "literalValue", | ||
"comment": "the rules grouped here, when preceded by ':', are found in their own separate rules", | ||
@@ -1223,3 +1243,3 @@ "patterns": [ | ||
"comment": "'#' ident", | ||
"match": "(#)\\s*([$_a-zA-Z][$_a-zA-Z0-9]*|\"[^\"]*(?:\"\"[^\"]*)*\"|!\\[[^\\]]*(?:\\]\\][^\\]]*)*\\])", | ||
"match": "(#)\\s*(\"[^\"]*(?:\"\"[^\"]*)*\"|!\\[[^\\]]*(?:\\]\\][^\\]]*)*\\]|[$_\\p{ID_Start}][$\\p{ID_Continue}\\u200C\\u200D]*)", | ||
"captures": { | ||
@@ -1268,2 +1288,3 @@ "1": { | ||
"bracketedExpression": { | ||
"name": "bracketedExpression", | ||
"begin": "\\(", | ||
@@ -1289,3 +1310,3 @@ "beginCaptures": { | ||
{ | ||
"match": "(?i)(?<!@|select from )(?:\\$?\\b[_a-z][$_a-z0-9]*|\"[^\"]*(?:\"\"[^\"]*)*\"|!\\[[^\\]]*(?:\\]\\][^\\]]*)*\\])", | ||
"match": "(?i)(?<!@|select from )(?:\"[^\"]*(?:\"\"[^\"]*)*\"|!\\[[^\\]]*(?:\\]\\][^\\]]*)*\\]|[$_\\p{ID_Start}][$\\p{ID_Continue}\\u200C\\u200D]*)", | ||
"name": "entity.other.attribute-name.cds" | ||
@@ -1306,2 +1327,3 @@ }, | ||
"extendAspectOrEntityOrTypeOrArtifact": { | ||
"name": "extendAspectOrEntityOrTypeOrArtifact", | ||
"comment": "TODO simplify begin pattern - would currently produce false positives; allow annotationAssignment_ll1", | ||
@@ -1358,2 +1380,3 @@ "begin": "(?i)\\b(extend)\\s+((aspect|entity|type)\\s+)?((?!@)\\S+)(\\s+(with)(\\s+(actions|definitions|columns|elements|enum))?|(?=\\s*{))", | ||
"extendProjection": { | ||
"name": "extendProjection", | ||
"comment": "TODO simplify begin pattern - would currently produce false positives; allow annotationAssignment_ll1", | ||
@@ -1406,2 +1429,3 @@ "begin": "(?i)\\b(extend)\\s+((projection)\\s+)?((?!@)\\S+)(\\s+(with)(\\s+(actions))?|(?=\\s*{))", | ||
"aspectDefOrEntityDefOrTypeDefOrEventDef": { | ||
"name": "aspectDefOrEntityDefOrTypeDefOrEventDef", | ||
"begin": "\\b(aspect|(abstract\\s+)?entity|type|event)\\b", | ||
@@ -1475,2 +1499,3 @@ "beginCaptures": { | ||
"asSelectOrProjection": { | ||
"name": "asSelectOrProjection", | ||
"begin": "\\b(as)\\b", | ||
@@ -1477,0 +1502,0 @@ "beginCaptures": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
1519889
8135
+ Added@sap/cds-compiler@4.5.0(transitive)
+ Addedignore@5.3.0(transitive)
+ Addedmarked@11.1.0(transitive)
- Removed@sap/cds-compiler@4.4.0(transitive)
- Removedignore@5.2.4(transitive)
- Removedmarked@10.0.0(transitive)
Updated@sap/cds-compiler@4.5.0
Updatedignore@5.3.0
Updatedmarked@11.1.0