Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update yaml-language-server to 0.5.8 (#257) #283

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 36 additions & 55 deletions server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"vscode-json-languageservice": "^3.3.1",
"vscode-languageserver": "^5.2.1",
"vscode-languageserver-protocol": "3.14.1",
"yaml-language-server": "0.4.0"
"yaml-language-server": "0.5.8",
"vscode-uri": "^2.0.3"
}
}
8 changes: 4 additions & 4 deletions server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import { IConnection, createConnection, TextDocuments, InitializeParams, InitializeResult, RequestType, TextDocument } from 'vscode-languageserver';
import { LanguageService, LanguageSettings } from 'yaml-language-server/out/server/src/languageservice/yamlLanguageService';
import { parse as parseYAML } from 'yaml-language-server/out/server/src/languageservice/parser/yamlParser';
import { parse as parseYAML } from 'yaml-language-server/out/server/src/languageservice/parser/yamlParser07';
import { removeDuplicatesObj } from 'yaml-language-server/out/server/src/languageservice/utils/arrUtils';
import { URI } from 'yaml-language-server/out/server/src/languageservice/utils/uri';
import { CustomSchemaContentRequest } from 'yaml-language-server/out/server/src/server';
import { URI } from 'vscode-uri';
import { CustomSchemaContentRequest } from 'yaml-language-server/out/server/src/requestTypes';
import { getLanguageService, ClientSettings } from './yamlLanguageService';

import { xhr, XHRResponse, configure as configureHttpRequests, getErrorStatusDescription } from 'request-light';
Expand Down Expand Up @@ -159,7 +159,7 @@ function updateConfiguration() {
schemas: [],
validate: enableValidation,
completion: false,
foramt: false
format: false
}
languageService.configure(settings, clientSetting);
documents.all().forEach(triggerValidation);
Expand Down
10 changes: 5 additions & 5 deletions server/src/services/yamlHover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { TextDocument, Position, Hover, Range } from "vscode-languageserver/lib/main";
import * as Parser from 'vscode-json-languageservice/lib/umd/parser/jsonParser';
import { SingleYAMLDocument } from 'yaml-language-server/out/server/src/languageservice/parser/yamlParser';
import { SingleYAMLDocument } from 'yaml-language-server/out/server/src/languageservice/parser/yamlParser07';
import { PromiseConstructor } from 'vscode-json-languageservice';
import * as path from 'path';
import * as fsextra from 'fs-extra';
Expand Down Expand Up @@ -39,11 +39,11 @@ export class YAMLHover {
}

let node = currentDoc.getNodeFromOffset(offset);
if (!node || (node.type === 'object' || node.type === 'array') && offset > node.start + 1 && offset < node.end - 1) {
if (!node || (node.type === 'object' || node.type === 'array') && offset > node.offset + 1 && offset < node.offset + node.length - 1) {
return this.promise.resolve(void 0);
}

if (node.type === 'string' && node.isKey && node.value != 'name') {
if (node.type === 'string' && node.value != 'name') {

if (node.parent && node.parent.type === 'property') {
let parent = <Parser.PropertyASTNode>node.parent;
Expand All @@ -56,9 +56,9 @@ export class YAMLHover {
let taskNode = <Parser.ArrayASTNode>grandparent.parent;

if (taskNode.location === 'tasks' || (taskNode.type === 'array' && this.moduleNames.indexOf(node.value) > -1)) {
let hoverRange = Range.create(document.positionAt(node.start), document.positionAt(node.end));
let hoverRange = Range.create(document.positionAt(node.offset), document.positionAt(node.offset + node.length));

return this.promise.resolve(this.createHover(node.getValue(), hoverRange));
return this.promise.resolve(this.createHover(node.value, hoverRange));
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion server/src/yamlLanguageService.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use strict'

import { YamlDocumentSymbols } from './services/yamlDocumentSymbol';
import { SchemaRequestService, YAMLDocument, LanguageSettings } from 'yaml-language-server/out/server/src/languageservice/yamlLanguageService';
import { SchemaRequestService, LanguageSettings } from 'yaml-language-server/out/server/src/languageservice/yamlLanguageService';
import { YAMLDocument } from 'yaml-language-server/out/server/src/languageservice/parser/yamlParser07';
import { YAMLValidation } from 'yaml-language-server/out/server/src/languageservice/services/yamlValidation';
import { JSONSchemaService } from 'yaml-language-server/out/server/src/languageservice/services/jsonSchemaService';
import { schemaContributions } from 'vscode-json-languageservice/lib/umd/services/configuration';
Expand Down