Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feat/generate-id
Browse files Browse the repository at this point in the history
  • Loading branch information
marufrasully committed Aug 21, 2024
2 parents eb374cf + bcd5523 commit 232dfcc
Show file tree
Hide file tree
Showing 13 changed files with 84 additions and 43 deletions.
6 changes: 6 additions & 0 deletions packages/language-server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 4.0.53

### Patch Changes

- bfcac90: activation process fine tuning

## 4.0.52

### Patch Changes
Expand Down
4 changes: 4 additions & 0 deletions packages/language-server/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ const defaultConfig = require("../../jest.config");

module.exports = {
...defaultConfig,
coveragePathIgnorePatterns: [
"<rootDir>/src/server.ts",
"<rootDir>/scripts/update-diagnostics-snapshots.js",
],
globals: {
"ts-jest": {
tsconfig: join(__dirname, "tsconfig-test.json"),
Expand Down
2 changes: 1 addition & 1 deletion packages/language-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ui5-language-assistant/language-server",
"version": "4.0.52",
"version": "4.0.53",
"private": true,
"description": "UI5 Language Server",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* istanbul ignore file - dev scripts don't need tests */
const klawSync = require("klaw-sync");
const { forEach, filter, map } = require("lodash");
const { resolve, dirname } = require("path");
Expand Down
1 change: 0 additions & 1 deletion packages/language-server/src/server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* istanbul ignore file */
import { forEach } from "lodash";
import {
createConnection,
Expand Down
6 changes: 6 additions & 0 deletions packages/vscode-ui5-language-assistant-bas-ext/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 4.0.70

### Patch Changes

- bfcac90: activation process fine tuning

## 4.0.69

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/vscode-ui5-language-assistant-bas-ext/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@ui5-language-assistant/vscode-ui5-language-assistant-bas-ext",
"description": "A wrapper module for BAS simple extension around Language Support For SAPUI5",
"license": "Apache-2.0",
"version": "4.0.69",
"version": "4.0.70",
"private": false,
"repository": {
"type": "git",
Expand All @@ -13,7 +13,7 @@
},
"devDependencies": {
"fs-extra": "10.1.0",
"vscode-ui5-language-assistant": "4.0.69"
"vscode-ui5-language-assistant": "4.0.70"
},
"files": [
"*.vsix",
Expand Down
8 changes: 8 additions & 0 deletions packages/vscode-ui5-language-assistant/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## 4.0.70

### Patch Changes

- bfcac90: activation process fine tuning
- Updated dependencies [bfcac90]
- @ui5-language-assistant/language-server@4.0.53

## 4.0.69

### Patch Changes
Expand Down
4 changes: 4 additions & 0 deletions packages/vscode-ui5-language-assistant/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ const defaultConfig = require("../../jest.config");

module.exports = {
...defaultConfig,
coveragePathIgnorePatterns: [
"<rootDir>/scripts/package-vsix.js",
"<rootDir>/src/extension.ts",
],
globals: {
"ts-jest": {
tsconfig: join(__dirname, "tsconfig-test.json"),
Expand Down
6 changes: 3 additions & 3 deletions packages/vscode-ui5-language-assistant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "UI5 Language Assistant",
"private": true,
"description": "Language Support For SAPUI5",
"version": "4.0.69",
"version": "4.0.70",
"publisher": "SAPOSS",
"icon": "resources/ui5-language-assistant.png",
"keywords": [
Expand All @@ -18,7 +18,7 @@
"main": "./lib/src/extension",
"activationEvents": [
"onFileSystem:manifest-schema",
"*"
"onLanguage:xml"
],
"contributes": {
"semanticTokenScopes": [
Expand Down Expand Up @@ -155,7 +155,7 @@
"update:schema": "ts-node --project tsconfig.cli.json scripts/manifest/run-update.ts"
},
"dependencies": {
"@ui5-language-assistant/language-server": "4.0.52",
"@ui5-language-assistant/language-server": "4.0.53",
"vscode-languageclient": "8.0.2",
"@prettier/plugin-xml": "2.2.0",
"prettier": "2.8.7"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* istanbul ignore file */
/**
* Workaround to: https://github.com/microsoft/vscode-vsce/issues/300
* This "sorts of" implements the (broken) `yarn list` with support for workspaces
Expand Down
83 changes: 49 additions & 34 deletions packages/vscode-ui5-language-assistant/src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* istanbul ignore file */
import { resolve } from "path";
import { readFileSync } from "fs";
import {
Expand Down Expand Up @@ -55,24 +54,15 @@ let client: LanguageClient;
let statusBarItem: StatusBarItem;
let currentModel: UI5Model | undefined;

export async function activate(context: ExtensionContext): Promise<void> {
// create the LanguageClient (+Server)
client = createLanguageClient(context);

// register semantic token provider
context.subscriptions.push(
languages.registerDocumentSemanticTokensProvider(
{ language: "xml" },
bindingSemanticTokensProvider,
bindingLegend
)
);

function init(context: ExtensionContext): void {
// create the StatusBarItem which displays the used UI5 version
statusBarItem = createStatusBarItem(context);

// show/hide and update the status bar
// create the LanguageClient (+Server)
client = createLanguageClient(context);

client.start().then(() => {
// show/hide and update the status bar
client.onNotification(
"UI5LanguageAssistant/ui5Model",
async (model: UI5Model): Promise<void> => await updateCurrentModel(model)
Expand All @@ -82,31 +72,56 @@ export async function activate(context: ExtensionContext): Promise<void> {
(error: Error) => handleContextError(error)
);
});
}

export async function activate(context: ExtensionContext): Promise<void> {
// complete initialization task asynchronously
init(context);

// register semantic token provider
context.subscriptions.push(
languages.registerDocumentSemanticTokensProvider(
{ language: "xml" },
bindingSemanticTokensProvider,
bindingLegend
)
);

window.onDidChangeActiveTextEditor(async () => {
await updateCurrentModel(undefined);
});

languages.registerDocumentFormattingEditProvider("xml", {
provideDocumentFormattingEdits(document: TextDocument): TextEdit[] {
if (isXMLView(document.uri.fsPath)) {
return formatDocument(document);
}
return [];
},
});
languages.registerDocumentRangeFormattingEditProvider("xml", {
provideDocumentRangeFormattingEdits(document, range, options): TextEdit[] {
if (isXMLView(document.uri.fsPath)) {
return formatRange(document, range, options);
}
return [];
},
});
client.start();
context.subscriptions.push(
languages.registerDocumentFormattingEditProvider("xml", {
provideDocumentFormattingEdits(document: TextDocument): TextEdit[] {
if (isXMLView(document.uri.fsPath)) {
return formatDocument(document);
}
return [];
},
})
);

const provider = await getManifestSchemaProvider(context);
context.subscriptions.push(
workspace.registerTextDocumentContentProvider(MANIFEST_SCHEMA, provider)
languages.registerDocumentRangeFormattingEditProvider("xml", {
provideDocumentRangeFormattingEdits(
document,
range,
options
): TextEdit[] {
if (isXMLView(document.uri.fsPath)) {
return formatRange(document, range, options);
}
return [];
},
})
);

context.subscriptions.push(
workspace.registerTextDocumentContentProvider(
MANIFEST_SCHEMA,
await getManifestSchemaProvider(context)
)
);
}

Expand Down
1 change: 1 addition & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ sonar.organization=sap-1
sonar.projectKey=SAP_ui5-language-assistant
sonar.sources=.
sonar.inclusions=**/*.ts
sonar.coverage.exclusions=packages/language-server/src/server.ts, packages/language-server/scripts/update-diagnostics-snapshots.js, packages/vscode-ui5-language-assistant/scripts/package-vsix.js, packages/vscode-ui5-language-assistant/src/extension.ts
sonar.exclusions=**/*.test.ts, **/test/**/*, **/test-packages/**/*, **/scripts/**/*.ts
sonar.cpd.exclusions=**/i18n.ts, **/*.test.ts, **/test/**/*, **/test-packages/**/*, **/scripts/**/*.ts
sonar.tests=.
Expand Down

0 comments on commit 232dfcc

Please sign in to comment.