Skip to content

Commit

Permalink
Update yaml-language-server
Browse files Browse the repository at this point in the history
The new yaml-language-server contains modern JavaScript that the
umd-compat-loader does not understand.

Instead, load the yaml-language-server types directly from the source
and set all it's dependencies as noParse.
  • Loading branch information
AndreasMadsen committed Oct 29, 2023
1 parent 1ecfc20 commit dcfdc8c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 18 deletions.
2 changes: 1 addition & 1 deletion github-action/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion github-action/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as core from '@actions/core';
import * as path from 'path';
import { YamlVersion } from 'yaml-language-server/lib/umd/languageservice/parser/yamlParser07';
import { YamlVersion } from 'yaml-language-server/out/server/src/languageservice/parser/yamlParser07';
import { SchemaMapping, validateDirectory } from '../src';

async function run() {
Expand Down
7 changes: 2 additions & 5 deletions github-action/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ module.exports = {
test: /\.ts$/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test:/node_modules[\\|/](prettier|yaml-language-server|vscode-languageserver|vscode-json-languageservice)/,
use: 'umd-compat-loader'
}
}
],
noParse: /node_modules[\\|/](prettier|vscode-languageserver|vscode-json-languageservice)/
},
resolve: {
extensions: [ '.ts', '.js' ],
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,18 @@
"ts-jest": "^27.0.5",
"ts-loader": "^9.2.6",
"ts-node": "^10.2.1",
"typescript": "^4.4.3",
"umd-compat-loader": "^2.1.2",
"typescript": "^4.9.5",
"vscode-json-languageservice": "^5.0.0",
"vscode-languageserver-textdocument": "^1.0.8",
"vscode-languageserver-types": "^3.17.3",
"webpack": "^5.53.0",
"webpack-cli": "^4.8.0"
"webpack": "^5.89.0",
"webpack-cli": "^4.10.0"
},
"dependencies": {
"commander": "^8.2.0",
"glob": "^7.1.7",
"umd-compat-loader": "^2.1.2",
"vscode-uri": "^3.0.2",
"yaml-language-server": "1.7.0"
"yaml-language-server": "1.14.0"
}
}
10 changes: 5 additions & 5 deletions src/lib.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import * as fs from 'fs';
import * as path from 'path';

import { YAMLSchemaService } from 'yaml-language-server/lib/umd/languageservice/services/yamlSchemaService';
import { YAMLValidation } from 'yaml-language-server/lib/umd/languageservice/services/yamlValidation';
import { WorkspaceContextService } from 'yaml-language-server/lib/umd/languageservice/yamlLanguageService';
import { YAMLSchemaService } from 'yaml-language-server/out/server/src/languageservice/services/yamlSchemaService';
import { YAMLValidation } from 'yaml-language-server/out/server/src/languageservice/services/yamlValidation';
import { WorkspaceContextService } from 'yaml-language-server/out/server/src/languageservice/yamlLanguageService';
import { TextDocument } from 'vscode-languageserver-textdocument';
import { Diagnostic } from 'vscode-languageserver-types';

import { readJson } from './util';
import { createSchemaRequestHandler } from './schema-handler';
import { glob } from 'glob';
import { TelemetryEvent } from 'yaml-language-server/lib/umd/languageserver/telemetry';
import { YamlVersion } from 'yaml-language-server/lib/umd/languageservice/parser/yamlParser07';
import { TelemetryEvent } from 'yaml-language-server/out/server/src/languageservice/telemetry';
import { YamlVersion } from 'yaml-language-server/out/server/src/languageservice/parser/yamlParser07';

export class ConsoleTelemetry {
constructor() {}
Expand Down
2 changes: 1 addition & 1 deletion src/schema-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as https from 'https';

import { URI } from 'vscode-uri';

import { isRelativePath } from 'yaml-language-server/lib/umd/languageservice/utils/paths';
import { isRelativePath } from 'yaml-language-server/out/server/src/languageservice/utils/paths';
import { SchemaRequestService } from 'yaml-language-server/lib/umd/languageservice/yamlLanguageService';
import { trimStartChars, relativeToAbsolutePath } from './util';

Expand Down

0 comments on commit dcfdc8c

Please sign in to comment.