@sap/cds-lsp
Advanced tools
Comparing version 7.8.2 to 7.9.0
@@ -10,2 +10,13 @@ # Changelog | ||
## 7.9.0 - 2024-05-03 | ||
### Fixed | ||
- code completion for elements snippet now works when annotating artifacts using paths such as `MyService.SomeEntity` or when triggered at particular positions including line start | ||
- some installations of IntelliJ on Windows did not work properly due to different URI encoding | ||
- maintain translation quickfix could have used an existing translation file of a reuse component | ||
### Also see | ||
- `@sap/cds-compiler` 4.9.0 | ||
## 7.8.2 - 2024-04-09 | ||
@@ -12,0 +23,0 @@ |
import { BigIntStats, Dirent, PathLike, StatOptions, Stats, WriteFileOptions } from 'node:fs'; | ||
import { TypedEmitter } from 'tiny-typed-emitter'; | ||
import * as LS from 'vscode-languageserver'; | ||
import { Range, _Connection, _Connection as IConnection } from 'vscode-languageserver'; | ||
import { _Connection, _Connection as IConnection } from 'vscode-languageserver'; | ||
import * as LSP from 'vscode-languageserver-protocol'; | ||
@@ -1075,3 +1075,3 @@ | ||
streamFiles<T>(predicate?: (file: _IWorkspaceFileVersion) => boolean, mode?: WorkspaceValidationMode | WorkspaceScanMode, mapper?: (file: _IWorkspaceFileVersion) => T): Generator<T>; | ||
getContent(uri: Uri): FileContent | T_FILE_DOES_NOT_EXIST; | ||
contentOf(uri: Uri): FileContent | T_FILE_DOES_NOT_EXIST; | ||
change(changedDiskDocs?: IWorkspaceDocumentsWithPossibleDeletions, changedOpenDocs?: IWorkspaceDocumentsWithPossibleDeletions, clone?: boolean): _IWorkspaceSnapshot; | ||
@@ -1107,6 +1107,6 @@ adapter: _IPathAdapter; | ||
export interface _ITranslationBroker { | ||
getTranslation(sourceUri: Uri, translationId: string): Translation | undefined; | ||
getAllTranslations(sourceFileUri: Uri): Translation[]; | ||
translationOf(sourceUri: Uri, translationId: string): Translation | undefined; | ||
allTranslationsOf(sourceFileUri: Uri): Translation[]; | ||
onTranslationFileChanged(translationFileUri: Uri, content: FileContent | T_FILE_DOES_NOT_EXIST): void; | ||
getMostRelevantTranslationFileUri(forSourceUri: Uri): FileUri | undefined; | ||
mostRelevantMaintainableTranslationFileFor(sourceUri: Uri): FileUri | undefined; | ||
getTranslationIndex(translationFileUri: FileUri): _II18nIndex; | ||
@@ -1145,9 +1145,9 @@ resetTranslations(): void; | ||
name: string; | ||
workspaceUri: Uri; | ||
workspaceRoot: AbsolutePath; | ||
translationBroker: _ITranslationBroker; | ||
documentationProvider: _IDocumentationProvider; | ||
uri: Uri; | ||
absolutePath: AbsolutePath; | ||
i18n: _ITranslationBroker; | ||
documentation: _IDocumentationProvider; | ||
readonly npmPackages: INpmPackages; | ||
workspaceSnapshot: _IWorkspaceSnapshot; | ||
lastRequestIndependentWorkspaceSnapshot: _IWorkspaceSnapshot; | ||
snapshot: _IWorkspaceSnapshot; | ||
lastRequestIndependentSnapshot: _IWorkspaceSnapshot; | ||
diagnostics: _IWorkspaceDiagnostics; | ||
@@ -1157,3 +1157,3 @@ triggerRevalidation(urisChanged?: Uri[]): Promise<{ | ||
}>; | ||
getCdsEnv(): Env; | ||
readonly env: Env; | ||
fetchTransitiveIndex(uri: Uri, context?: IIndexContext): Promise<IBlitzIndex | undefined>; | ||
@@ -1164,3 +1164,3 @@ fetchFileIndex(uri: Uri, context?: IIndexContext): Promise<_IFileIndex>; | ||
fetchAst(uri: Uri, snapshot?: _IWorkspaceSnapshot): Promise<XsnCompileModel>; | ||
getContent(uri: Uri): FileContent | T_FILE_DOES_NOT_EXIST; | ||
contentOf(uri: Uri): FileContent | T_FILE_DOES_NOT_EXIST; | ||
ensureScanned(): Promise<void>; | ||
@@ -1171,13 +1171,13 @@ progressSnapshot(changedDiskDocuments?: IWorkspaceDocumentsWithPossibleDeletions, changedOpenDocuments?: IWorkspaceDocumentsWithPossibleDeletions, updateCurrentRequestSnapshot?: boolean): IWorkspaceUpdated; | ||
export interface _IUsingPathResolver { | ||
resolveUsingPath(triggerUri: Uri, importPath: UsingPath, workspaceFolder: _IWorkspaceFolder): FileUri | undefined; | ||
resolveUsingPath(triggerUri: Uri, importPath: UsingPath, folder: _IWorkspaceFolder): FileUri | undefined; | ||
} | ||
export interface WorkspaceServiceEvents { | ||
onWorkspaceFolderAdded: (workspaceFolder: _IWorkspaceFolder) => void; | ||
onWorkspaceFolderAdded: (folder: _IWorkspaceFolder) => void; | ||
} | ||
export interface _IWorkspaceService extends TypedEmitter<WorkspaceServiceEvents> { | ||
getWorkspaceFolder(uri: Uri): _IWorkspaceFolder; | ||
workspaceFolders(filter?: (wsf: _IWorkspaceFolder) => boolean): _IWorkspaceFolder[]; | ||
getWorkspaceSettingsPath(): AbsolutePath | undefined; | ||
addWorkspaceFolder(workspaceFolderConfig: LSP.WorkspaceFolder): _IWorkspaceFolder | undefined; | ||
removeWorkspaceFolder(rootUri: Uri): void; | ||
folderFor(uri: Uri): _IWorkspaceFolder; | ||
folders(filter?: (wsf: _IWorkspaceFolder) => boolean): _IWorkspaceFolder[]; | ||
readonly workspaceSettingsPath: AbsolutePath | undefined; | ||
addFolder(workspaceFolderConfig: LSP.WorkspaceFolder): _IWorkspaceFolder | undefined; | ||
removeFolder(rootUri: Uri): void; | ||
} | ||
@@ -1248,3 +1248,3 @@ declare enum QuickFixCommands { | ||
fetchAnnotationHandlers(): Promise<IInternalAnnotationContribution[]>; | ||
prettyPrinter: unknown; | ||
formatter: unknown; | ||
trace: ITrace; | ||
@@ -1256,5 +1256,5 @@ telemetry: _ITelemetry; | ||
sendDiagnostics(params: LSP.PublishDiagnosticsParams): Promise<void>; | ||
userInterface: IUserInterface; | ||
applyWorkspaceEdits(params: LSP.ApplyWorkspaceEditParams): Promise<any>; | ||
workspaceService: _IWorkspaceService; | ||
ui: IUserInterface; | ||
applyWorkspaceEdits(params: LSP.ApplyWorkspaceEditParams): Promise<LSP.ApplyWorkspaceEditResult>; | ||
readonly workspace: _IWorkspaceService; | ||
usingPathResolver: _IUsingPathResolver; | ||
@@ -1274,3 +1274,3 @@ moduleLoader: _IModuleLoader; | ||
message: string; | ||
reveaOutputWindowlIfHidden: boolean; | ||
revealOutputWindowlIfHidden: boolean; | ||
} | ||
@@ -1284,6 +1284,6 @@ export declare const StatusMessageNotification = "cds/statusMessage"; | ||
export interface IUserInterface { | ||
userOutput(message: string, revealOutputWindowIfHidden?: boolean): void; | ||
statusMessage(message: string, millisToShow?: number): void; | ||
userNotification(message: string, type?: LSP.MessageType): void; | ||
userPopup(type: PopupType, message: string, ...buttons: string[]): Promise<string>; | ||
output(message: string, revealOutputWindowIfHidden?: boolean): void; | ||
status(message: string, millisToShow?: number): void; | ||
notification(message: string, type?: LSP.MessageType): void; | ||
popup(type: PopupType, message: string, ...buttons: string[]): Promise<string>; | ||
} | ||
@@ -1295,3 +1295,3 @@ export interface _ILanguageServerEx extends _ILanguageServer { | ||
export interface IRequest { | ||
readonly languageServer: _ILanguageServer; | ||
readonly server: _ILanguageServer; | ||
} | ||
@@ -1326,3 +1326,3 @@ export interface _IDocumentationProvider { | ||
export interface IFactory { | ||
createAnnotationHandlerProvider(languageServer: _ILanguageServer): IAnnotationHandlerProvider; | ||
createAnnotationHandlerProvider(server: _ILanguageServer): IAnnotationHandlerProvider; | ||
createOptions(): ILspOptions; | ||
@@ -1335,9 +1335,9 @@ getTrace(): ITrace; | ||
createServer(): _ILanguageServerEx; | ||
createService(languageServer: _ILanguageServer): _IWorkspaceService; | ||
createWorkspace(kind: "outsider" | "untitled", languageServer: _ILanguageServer): _IWorkspaceFolder; | ||
createWorkspace(kind: "normal" | WorkspaceFolderKind, languageServer: _ILanguageServer, name: string, adapter: _IPathAdapter): _IWorkspaceFolder; | ||
createWorkspace(server: _ILanguageServer): _IWorkspaceService; | ||
createFolder(kind: "outsider" | "untitled", server: _ILanguageServer): _IWorkspaceFolder; | ||
createFolder(kind: "normal" | WorkspaceFolderKind, server: _ILanguageServer, name: string, adapter: _IPathAdapter): _IWorkspaceFolder; | ||
createSnapshot(context: _IWorkspaceStateContext, scanning: boolean): _IWorkspaceSnapshot; | ||
createFile(uri: Uri, content: FileContent, isOpen?: boolean): _IWorkspaceFileVersion; | ||
createCompiler(options: ILspOptions, loader: _IModuleLoader): _ICompiler; | ||
createCdsTyperWrapper(languageServer: _ILanguageServer): ICdsTyperWrapper; | ||
createCdsTyperWrapper(server: _ILanguageServer): ICdsTyperWrapper; | ||
createTelemetry(connection: _Connection): _ITelemetry; | ||
@@ -1344,0 +1344,0 @@ getContributionLoader(): _IContributionLoader; |
@@ -9,2 +9,3 @@ # Installation | ||
- [Visual Studio Code](https://cap.cloud.sap/docs/get-started/tools#vscode) | ||
- [IntelliJ](https://github.com/cap-js/cds-intellij) | ||
- [Eclipse](https://cap.cloud.sap/docs/get-started/tools#eclipse) | ||
@@ -14,7 +15,6 @@ ### Generic IDE support | ||
- [VIM](https://www.vim.org/) has several options, e.g. [ALE](https://github.com/dense-analysis/ale) | ||
- [Jetbrain IDEs](https://www.jetbrains.com/products.html#type=ide) (IntelliJ IDEA, WebStorm, ...), e.g. [LSP Support](https://plugins.jetbrains.com/plugin/10209-lsp-support) or [lsp4intellij](https://github.com/ballerina-platform/lsp4intellij) | ||
- Emacs, ... | ||
#### Requirements | ||
`@sap/cds-lsp` is a NodeJS module. As such it requires NodeJS installed on the client machine. Minimum version is 14.19+. | ||
`@sap/cds-lsp` is a NodeJS module. As such it requires NodeJS installed on the client machine. Minimum version is 18.15. | ||
@@ -117,5 +117,6 @@ #### Start-up | ||
#### Syntax Highlighting | ||
For performance reasons, the language server protocol does not provide support for syntax highlighting. | ||
For performance reasons, syntax highlighting is not done via the language server protocol. | ||
A [TextMate grammar](https://macromates.com/manual/en/language_grammars) aside of the language server provides this. | ||
`@sap/cds-lsp` comes with a TextMate grammar file [included](../syntaxes/cds.tmLanguage.json) for the CDS language. | ||
`@sap/cds-lsp` comes with a TextMate grammar file [included](../syntaxes/cds.tmLanguage.json) for the CDS language. | ||
Additionally `@sap/cds-lsp` supports semantic highlighting. This is a feature of the language server protocol and is supported by some IDEs. | ||
@@ -122,0 +123,0 @@ While specific client extensions usually integrate this by default, a generic integration requires to configure this separately. |
{ | ||
"name": "@sap/cds-lsp", | ||
"description": "Language server for CDS", | ||
"version": "7.8.2", | ||
"version": "7.9.0", | ||
"homepage": "https://cap.cloud.sap/", | ||
@@ -38,6 +38,6 @@ "author": "SAP SE (https://www.sap.com)", | ||
"dependencies": { | ||
"@sap/cds-compiler": "4.8.0", | ||
"@sap/cds-compiler": "4.9.0", | ||
"ignore": "5.3.1", | ||
"json-source-map": "0.6.1", | ||
"marked": "12.0.1", | ||
"marked": "12.0.2", | ||
"tiny-typed-emitter": "2.1.0", | ||
@@ -44,0 +44,0 @@ "vscode-languageserver": "9.0.1", |
@@ -5,3 +5,4 @@ # CDS Language Server | ||
for SAP's Core Data Services ([CDS](https://cap.cloud.sap/docs/cds/cdl)). | ||
It can be used in many popular IDEs like, for example, [Visual Studio Code](https://cap.cloud.sap/docs/get-started/tools#vscode) | ||
It can be used in many popular IDEs like, for example, [Visual Studio Code](https://cap.cloud.sap/docs/get-started/tools#vscode), | ||
[IntelliJ](https://github.com/cap-js/cds-intellij), | ||
or [Eclipse](https://cap.cloud.sap/docs/get-started/tools#eclipse). | ||
@@ -39,2 +40,3 @@ It provides many useful features for working with and enjoying CDS sources. | ||
- annotations for documentation | ||
- annotate all elements of an entity | ||
@@ -44,6 +46,6 @@ - Quick fixes to | ||
- maintain missing translation | ||
- convert `@cds.doc` and `@description` annotations to doc comments | ||
- convert `@description` annotations to doc comments | ||
- Inventory (symbols) for | ||
- current file | ||
- current file (Outline) | ||
- workspace incl. query capabilities to select, for example, artifact types, names, also include reuse models | ||
@@ -55,2 +57,3 @@ | ||
- translations | ||
- `README.md` and `package.json#description` | ||
@@ -60,3 +63,3 @@ - Code formatting | ||
- selected range | ||
- on-the-fly when completing statements using ```;``` or ```}``` | ||
- on-the-fly when completing statements using `;` or `}` | ||
- on save (depending on the IDE) | ||
@@ -71,11 +74,16 @@ - on paste (depending on the IDE) | ||
- Code formatting via CLI | ||
- Code formatting via CLI (incl. verification mode) | ||
- Translation support | ||
- properties, JSON, and CSV files | ||
- navigate to translation definitions from translation IDs like ```'{i18n>customerName}'``` | ||
- navigate to translation definitions from translation IDs like `'{i18n>customerName}'` | ||
- show translations on hover | ||
- quickfix to maintain missing translations | ||
- Plugin framework for external handlers of annotation domains | ||
- Annotation support via external plugin | ||
- diagnostics | ||
- where-used navigation | ||
- hover information | ||
- code completion | ||
- quick fixes for translations | ||
@@ -82,0 +90,0 @@ ## Usage |
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
1608304
96
22
8447
+ Added@sap/cds-compiler@4.9.0(transitive)
+ Addedmarked@12.0.2(transitive)
- Removed@sap/cds-compiler@4.8.0(transitive)
- Removedmarked@12.0.1(transitive)
Updated@sap/cds-compiler@4.9.0
Updatedmarked@12.0.2