@volar/language-service
Advanced tools
Comparing version 1.0.20 to 1.0.21
@@ -11,3 +11,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
return []; | ||
}, (plugin, document, range) => { var _a; return (_a = plugin.getColorPresentations) === null || _a === void 0 ? void 0 : _a.call(plugin, document, color, range); }, (data, map) => data.map(cp => { | ||
}, (plugin, document, range) => { var _a; return (_a = plugin.getColorPresentations) === null || _a === void 0 ? void 0 : _a.call(plugin, document, color, range); }, (data, map) => map ? data.map(cp => { | ||
if (cp.textEdit) { | ||
@@ -28,3 +28,3 @@ const range = map.toSourceRange(cp.textEdit.range); | ||
return cp; | ||
}).filter(shared.notEmpty)); | ||
}).filter(shared.notEmpty) : data); | ||
}; | ||
@@ -31,0 +31,0 @@ } |
@@ -9,3 +9,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
return (0, featureWorkers_1.documentFeatureWorker)(context, uri, file => !!file.capabilities.documentSymbol, // TODO: add color capability setting | ||
(plugin, document) => { var _a; return (_a = plugin.findDocumentColors) === null || _a === void 0 ? void 0 : _a.call(plugin, document); }, (data, map) => data.map(color => { | ||
(plugin, document) => { var _a; return (_a = plugin.findDocumentColors) === null || _a === void 0 ? void 0 : _a.call(plugin, document); }, (data, map) => map ? data.map(color => { | ||
const range = map.toSourceRange(color.range); | ||
@@ -15,3 +15,3 @@ if (range) { | ||
} | ||
}).filter(shared.notEmpty), arr => arr.flat()); | ||
}).filter(shared.notEmpty) : data, arr => arr.flat()); | ||
}; | ||
@@ -18,0 +18,0 @@ } |
@@ -9,3 +9,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
return (0, featureWorkers_1.documentFeatureWorker)(context, uri, file => !!file.capabilities.documentSymbol, // TODO: add color capabilitie setting | ||
(plugin, document) => { var _a; return (_a = plugin.findDocumentSymbols) === null || _a === void 0 ? void 0 : _a.call(plugin, document); }, (data, map) => (0, transforms_1.transformSymbolInformations)(data, location => { | ||
(plugin, document) => { var _a; return (_a = plugin.findDocumentSymbols) === null || _a === void 0 ? void 0 : _a.call(plugin, document); }, (data, map) => map ? (0, transforms_1.transformSymbolInformations)(data, location => { | ||
const range = map.toSourceRange(location.range); | ||
@@ -16,3 +16,3 @@ if (range) { | ||
} | ||
}), arr => arr.flat()); | ||
}) : data, arr => arr.flat()); | ||
}; | ||
@@ -19,0 +19,0 @@ } |
@@ -7,6 +7,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
return (uri, position) => { | ||
return (0, featureWorkers_1.languageFeatureWorker)(context, uri, position, (position, map) => map.toGeneratedPositions(position, data => !!data.completion), (plugin, document, position) => { var _a; return (_a = plugin.findLinkedEditingRanges) === null || _a === void 0 ? void 0 : _a.call(plugin, document, position); }, (data, map) => ({ | ||
return (0, featureWorkers_1.languageFeatureWorker)(context, uri, position, (position, map) => map.toGeneratedPositions(position, data => !!data.completion), (plugin, document, position) => { var _a; return (_a = plugin.findLinkedEditingRanges) === null || _a === void 0 ? void 0 : _a.call(plugin, document, position); }, (data, map) => map ? ({ | ||
wordPattern: data.wordPattern, | ||
ranges: data.ranges.map(range => map.toSourceRange(range)).filter(shared.notEmpty), | ||
})); | ||
}) : data); | ||
}; | ||
@@ -13,0 +13,0 @@ } |
@@ -18,3 +18,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
return []; | ||
}, (plugin, document, positions) => { var _a; return (_a = plugin.getSelectionRanges) === null || _a === void 0 ? void 0 : _a.call(plugin, document, positions); }, (item, map) => (0, transforms_1.transformSelectionRanges)(item, range => map.toSourceRange(range)), results => { | ||
}, (plugin, document, positions) => { var _a; return (_a = plugin.getSelectionRanges) === null || _a === void 0 ? void 0 : _a.call(plugin, document, positions); }, (item, map) => map ? (0, transforms_1.transformSelectionRanges)(item, range => map.toSourceRange(range)) : item, results => { | ||
for (let i = 0; i < results[0].length; i++) { | ||
@@ -21,0 +21,0 @@ const first = results[0][i]; |
@@ -35,3 +35,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
cacheData.list = (0, transforms_1.transformCompletionList)(embeddedCompletionList, range => map.toSourceRange(range), (newItem, oldItem) => newItem.data = { | ||
cacheData.list = (0, transforms_1.transformCompletionList)(embeddedCompletionList, range => map.toSourceRange(range), map.virtualFileDocument, (newItem, oldItem) => newItem.data = { | ||
uri, | ||
@@ -104,3 +104,3 @@ originalItem: oldItem, | ||
} | ||
const completionList = (0, transforms_1.transformCompletionList)(embeddedCompletionList, range => map.toSourceRange(range), (newItem, oldItem) => newItem.data = { | ||
const completionList = (0, transforms_1.transformCompletionList)(embeddedCompletionList, range => map.toSourceRange(range), map.virtualFileDocument, (newItem, oldItem) => newItem.data = { | ||
uri, | ||
@@ -107,0 +107,0 @@ originalItem: oldItem, |
@@ -44,3 +44,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return map.toSourceRange(embeddedRange); | ||
}); | ||
}, map.virtualFileDocument); | ||
} | ||
@@ -47,0 +47,0 @@ } |
@@ -58,3 +58,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
const position = map.toSourcePosition(_inlayHint.position); | ||
const edits = (_a = _inlayHint.textEdits) === null || _a === void 0 ? void 0 : _a.map(textEdit => (0, transforms_1.transformTextEdit)(textEdit, range => map.toSourceRange(range))).filter(shared.notEmpty); | ||
const edits = (_a = _inlayHint.textEdits) === null || _a === void 0 ? void 0 : _a.map(textEdit => (0, transforms_1.transformTextEdit)(textEdit, range => map.toSourceRange(range), map.virtualFileDocument)).filter(shared.notEmpty); | ||
if (position) { | ||
@@ -61,0 +61,0 @@ return Object.assign(Object.assign({}, _inlayHint), { position, |
@@ -5,3 +5,3 @@ import type { TextDocument } from 'vscode-languageserver-textdocument'; | ||
import { SourceMapWithDocuments } from '../documents'; | ||
export declare function documentFeatureWorker<T>(context: LanguageServiceRuntimeContext, uri: string, isValidSourceMap: (file: VirtualFile, sourceMap: SourceMapWithDocuments<FileRangeCapabilities>) => boolean, worker: (plugin: LanguageServicePluginInstance, document: TextDocument) => T, transform: (result: NonNullable<Awaited<T>>, sourceMap: SourceMapWithDocuments<FileRangeCapabilities>) => Awaited<T> | undefined, combineResult?: (results: NonNullable<Awaited<T>>[]) => NonNullable<Awaited<T>>): Promise<NonNullable<Awaited<T>> | undefined>; | ||
export declare function languageFeatureWorker<T, K>(context: LanguageServiceRuntimeContext, uri: string, arg: K, transformArg: (arg: K, sourceMap: SourceMapWithDocuments<FileRangeCapabilities>, file: VirtualFile) => Generator<K> | K[], worker: (plugin: LanguageServicePluginInstance, document: TextDocument, arg: K, sourceMap: SourceMapWithDocuments<FileRangeCapabilities> | undefined, file: VirtualFile | undefined) => T, transform: (result: NonNullable<Awaited<T>>, sourceMap: SourceMapWithDocuments<FileRangeCapabilities>) => Awaited<T> | undefined, combineResult?: (results: NonNullable<Awaited<T>>[]) => NonNullable<Awaited<T>>, reportProgress?: (result: NonNullable<Awaited<T>>) => void): Promise<NonNullable<Awaited<T>> | undefined>; | ||
export declare function documentFeatureWorker<T>(context: LanguageServiceRuntimeContext, uri: string, isValidSourceMap: (file: VirtualFile, sourceMap: SourceMapWithDocuments<FileRangeCapabilities>) => boolean, worker: (plugin: LanguageServicePluginInstance, document: TextDocument) => T, transform: (result: NonNullable<Awaited<T>>, sourceMap: SourceMapWithDocuments<FileRangeCapabilities> | undefined) => Awaited<T> | undefined, combineResult?: (results: NonNullable<Awaited<T>>[]) => NonNullable<Awaited<T>>): Promise<NonNullable<Awaited<T>> | undefined>; | ||
export declare function languageFeatureWorker<T, K>(context: LanguageServiceRuntimeContext, uri: string, arg: K, transformArg: (arg: K, sourceMap: SourceMapWithDocuments<FileRangeCapabilities>, file: VirtualFile) => Generator<K> | K[], worker: (plugin: LanguageServicePluginInstance, document: TextDocument, arg: K, sourceMap: SourceMapWithDocuments<FileRangeCapabilities> | undefined, file: VirtualFile | undefined) => T, transform: (result: NonNullable<Awaited<T>>, sourceMap: SourceMapWithDocuments<FileRangeCapabilities> | undefined) => Awaited<T> | undefined, combineResult?: (results: NonNullable<Awaited<T>>[]) => NonNullable<Awaited<T>>, reportProgress?: (result: NonNullable<Awaited<T>>) => void): Promise<NonNullable<Awaited<T>> | undefined>; |
@@ -53,3 +53,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
for (const plugin of context.plugins) { | ||
const result = yield worker(plugin, document, arg, undefined, undefined); | ||
const embeddedResult = yield worker(plugin, document, arg, undefined, undefined); | ||
if (!embeddedResult) | ||
continue; | ||
const result = transform(embeddedResult, undefined); | ||
if (!result) | ||
@@ -56,0 +59,0 @@ continue; |
{ | ||
"name": "@volar/language-service", | ||
"version": "1.0.20", | ||
"version": "1.0.21", | ||
"main": "out/index.js", | ||
@@ -16,7 +16,7 @@ "license": "MIT", | ||
"dependencies": { | ||
"@volar/language-core": "1.0.20", | ||
"@volar/shared": "1.0.20", | ||
"@volar/source-map": "1.0.20", | ||
"@volar/transforms": "1.0.20", | ||
"@volar/typescript-faster": "1.0.20", | ||
"@volar/language-core": "1.0.21", | ||
"@volar/shared": "1.0.21", | ||
"@volar/source-map": "1.0.21", | ||
"@volar/transforms": "1.0.21", | ||
"@volar/typescript-faster": "1.0.21", | ||
"vscode-html-languageservice": "^5.0.3", | ||
@@ -28,3 +28,3 @@ "vscode-json-languageservice": "^5.1.3", | ||
}, | ||
"gitHead": "e00f068e812677791c93efe9cf20995764350ec6" | ||
"gitHead": "72332760759e06eed18e62026185cbad70250367" | ||
} |
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
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
183162
3287
+ Added@volar/language-core@1.0.21(transitive)
+ Added@volar/shared@1.0.21(transitive)
+ Added@volar/source-map@1.0.21(transitive)
+ Added@volar/transforms@1.0.21(transitive)
+ Added@volar/typescript-faster@1.0.21(transitive)
- Removed@volar/language-core@1.0.20(transitive)
- Removed@volar/shared@1.0.20(transitive)
- Removed@volar/source-map@1.0.20(transitive)
- Removed@volar/transforms@1.0.20(transitive)
- Removed@volar/typescript-faster@1.0.20(transitive)
Updated@volar/language-core@1.0.21
Updated@volar/shared@1.0.21
Updated@volar/source-map@1.0.21
Updated@volar/transforms@1.0.21