Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@volar/language-service

Package Overview
Dependencies
Maintainers
1
Versions
233
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@volar/language-service - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

out/utils/common.d.ts

17

out/baseDocumentService.d.ts
import { LanguageModule } from '@volar/language-core';
import * as shared from '@volar/shared';
import { TextDocument } from 'vscode-languageserver-textdocument';

@@ -15,13 +14,13 @@ import { DocumentServiceRuntimeContext, LanguageServicePlugin, LanguageServicePluginContext } from './types';

export declare function createDocumentService(context: DocumentServiceRuntimeContext): {
format: (document: shared._1.TextDocument, options: _.FormattingOptions, range?: _.Range | undefined, onTypeParams?: {
format: (document: TextDocument, options: _.FormattingOptions, range?: _.Range | undefined, onTypeParams?: {
ch: string;
position: _.Position;
} | undefined) => Promise<_.TextEdit[] | undefined>;
getFoldingRanges: (document: shared._1.TextDocument) => Promise<_.FoldingRange[] | undefined>;
getSelectionRanges: (document: shared._1.TextDocument, positions: _.Position[]) => Promise<_.SelectionRange[] | undefined>;
findLinkedEditingRanges: (document: shared._1.TextDocument, position: _.Position) => Promise<_.LinkedEditingRanges | undefined>;
findDocumentSymbols: (document: shared._1.TextDocument) => Promise<_.SymbolInformation[] | undefined>;
findDocumentColors: (document: shared._1.TextDocument) => Promise<_.ColorInformation[] | undefined>;
getColorPresentations: (document: shared._1.TextDocument, color: _.Color, range: _.Range) => Promise<_.ColorPresentation[] | undefined>;
doAutoInsert: (document: shared._1.TextDocument, position: _.Position, options: {
getFoldingRanges: (document: TextDocument) => Promise<_.FoldingRange[] | undefined>;
getSelectionRanges: (document: TextDocument, positions: _.Position[]) => Promise<_.SelectionRange[] | undefined>;
findLinkedEditingRanges: (document: TextDocument, position: _.Position) => Promise<_.LinkedEditingRanges | undefined>;
findDocumentSymbols: (document: TextDocument) => Promise<_.SymbolInformation[] | undefined>;
findDocumentColors: (document: TextDocument) => Promise<_.ColorInformation[] | undefined>;
getColorPresentations: (document: TextDocument, color: _.Color, range: _.Range) => Promise<_.ColorPresentation[] | undefined>;
doAutoInsert: (document: TextDocument, position: _.Position, options: {
lastChange: {

@@ -28,0 +27,0 @@ range: _.Range;

import { createEmbeddedLanguageServiceHost, LanguageServiceHost } from '@volar/language-core';
import * as executeCommand from './languageFeatures/executeCommand';
import { LanguageServicePlugin, LanguageServicePluginContext, LanguageServiceRuntimeContext } from './types';
import type * as ts from 'typescript/lib/tsserverlibrary';
import type * as _ from 'vscode-languageserver-protocol';

@@ -5,0 +6,0 @@ export type LanguageService = ReturnType<typeof createLanguageService>;

import { DocumentRegistry, EmbeddedFile, PositionCapabilities, SourceFile, TeleportMappingData } from '@volar/language-core';
import * as shared from '@volar/shared';
import { Mapping, SourceMapBase } from '@volar/source-map';

@@ -19,11 +18,11 @@ import * as vscode from 'vscode-languageserver-protocol';

protected toRanges(range: vscode.Range, filter: (data: Data) => boolean, api: 'toSourcePositionsBase' | 'toGeneratedPositionsBase', api2: 'matchSourcePosition' | 'matchGeneratedPosition'): Generator<vscode.Range, void, unknown>;
toSourcePosition(position: vscode.Position, filter?: (data: Data) => boolean, baseOffset?: 'left' | 'right'): shared._1.Position | undefined;
toGeneratedPosition(position: vscode.Position, filter?: (data: Data) => boolean, baseOffset?: 'left' | 'right'): shared._1.Position | undefined;
toSourcePositions(position: vscode.Position, filter?: (data: Data) => boolean, baseOffset?: 'left' | 'right'): Generator<shared._1.Position, void, unknown>;
toGeneratedPositions(position: vscode.Position, filter?: (data: Data) => boolean, baseOffset?: 'left' | 'right'): Generator<shared._1.Position, void, unknown>;
toSourcePositionsBase(position: vscode.Position, filter?: (data: Data) => boolean, baseOffset?: 'left' | 'right'): Generator<readonly [shared._1.Position, Mapping<Data>], void, unknown>;
toGeneratedPositionsBase(position: vscode.Position, filter?: (data: Data) => boolean, baseOffset?: 'left' | 'right'): Generator<readonly [shared._1.Position, Mapping<Data>], void, unknown>;
protected toPositions(position: vscode.Position, filter: (data: Data) => boolean, fromDoc: TextDocument, toDoc: TextDocument, from: 'sourceRange' | 'generatedRange', to: 'sourceRange' | 'generatedRange', baseOffset: 'left' | 'right'): Generator<readonly [shared._1.Position, Mapping<Data>], void, unknown>;
protected matchSourcePosition(position: vscode.Position, mapping: Mapping, baseOffset: 'left' | 'right'): shared._1.Position | undefined;
protected matchGeneratedPosition(position: vscode.Position, mapping: Mapping, baseOffset: 'left' | 'right'): shared._1.Position | undefined;
toSourcePosition(position: vscode.Position, filter?: (data: Data) => boolean, baseOffset?: 'left' | 'right'): import("vscode-languageserver-textdocument").Position | undefined;
toGeneratedPosition(position: vscode.Position, filter?: (data: Data) => boolean, baseOffset?: 'left' | 'right'): import("vscode-languageserver-textdocument").Position | undefined;
toSourcePositions(position: vscode.Position, filter?: (data: Data) => boolean, baseOffset?: 'left' | 'right'): Generator<import("vscode-languageserver-textdocument").Position, void, unknown>;
toGeneratedPositions(position: vscode.Position, filter?: (data: Data) => boolean, baseOffset?: 'left' | 'right'): Generator<import("vscode-languageserver-textdocument").Position, void, unknown>;
toSourcePositionsBase(position: vscode.Position, filter?: (data: Data) => boolean, baseOffset?: 'left' | 'right'): Generator<readonly [import("vscode-languageserver-textdocument").Position, Mapping<Data>], void, unknown>;
toGeneratedPositionsBase(position: vscode.Position, filter?: (data: Data) => boolean, baseOffset?: 'left' | 'right'): Generator<readonly [import("vscode-languageserver-textdocument").Position, Mapping<Data>], void, unknown>;
protected toPositions(position: vscode.Position, filter: (data: Data) => boolean, fromDoc: TextDocument, toDoc: TextDocument, from: 'sourceRange' | 'generatedRange', to: 'sourceRange' | 'generatedRange', baseOffset: 'left' | 'right'): Generator<readonly [import("vscode-languageserver-textdocument").Position, Mapping<Data>], void, unknown>;
protected matchSourcePosition(position: vscode.Position, mapping: Mapping, baseOffset: 'left' | 'right'): import("vscode-languageserver-textdocument").Position | undefined;
protected matchGeneratedPosition(position: vscode.Position, mapping: Mapping, baseOffset: 'left' | 'right'): import("vscode-languageserver-textdocument").Position | undefined;
}

@@ -40,3 +39,3 @@ export declare class EmbeddedDocumentSourceMap extends SourceMap<PositionCapabilities> {

constructor(embeddedFile: EmbeddedFile, document: TextDocument, mappings: Mapping<TeleportMappingData>[]);
findTeleports(start: vscode.Position): Generator<readonly [shared._1.Position, import("@volar/language-core").TeleportCapabilities], void, unknown>;
findTeleports(start: vscode.Position): Generator<readonly [import("vscode-languageserver-textdocument").Position, import("@volar/language-core").TeleportCapabilities], void, unknown>;
}

@@ -48,6 +47,6 @@ export declare function parseSourceFileDocuments(rootUri: URI, mapper: DocumentRegistry): {

getSourceMap: (embedded: EmbeddedFile) => EmbeddedDocumentSourceMap;
getEmbeddedDocument: (embeddedFile: SourceFile) => shared._1.TextDocument;
getEmbeddedDocument: (embeddedFile: SourceFile) => TextDocument;
getSourceMaps: () => EmbeddedDocumentSourceMap[];
getTeleports: () => TeleportSourceMap[];
getDocument: () => shared._1.TextDocument;
getDocument: () => TextDocument;
}[];

@@ -58,6 +57,6 @@ get: (uri: string) => {

getSourceMap: (embedded: EmbeddedFile) => EmbeddedDocumentSourceMap;
getEmbeddedDocument: (embeddedFile: SourceFile) => shared._1.TextDocument;
getEmbeddedDocument: (embeddedFile: SourceFile) => TextDocument;
getSourceMaps: () => EmbeddedDocumentSourceMap[];
getTeleports: () => TeleportSourceMap[];
getDocument: () => shared._1.TextDocument;
getDocument: () => TextDocument;
} | undefined;

@@ -68,6 +67,6 @@ fromEmbeddedDocument: (document: TextDocument) => {

getSourceMap: (embedded: EmbeddedFile) => EmbeddedDocumentSourceMap;
getEmbeddedDocument: (embeddedFile: SourceFile) => shared._1.TextDocument;
getEmbeddedDocument: (embeddedFile: SourceFile) => TextDocument;
getSourceMaps: () => EmbeddedDocumentSourceMap[];
getTeleports: () => TeleportSourceMap[];
getDocument: () => shared._1.TextDocument;
getDocument: () => TextDocument;
} | undefined;

@@ -81,6 +80,6 @@ sourceMapFromEmbeddedDocumentUri: (uri: string) => EmbeddedDocumentSourceMap | undefined;

getSourceMap: (embedded: EmbeddedFile) => EmbeddedDocumentSourceMap;
getEmbeddedDocument: (embeddedFile: SourceFile) => shared._1.TextDocument;
getEmbeddedDocument: (embeddedFile: SourceFile) => TextDocument;
getSourceMaps: () => EmbeddedDocumentSourceMap[];
getTeleports: () => TeleportSourceMap[];
getDocument: () => shared._1.TextDocument;
getDocument: () => TextDocument;
};

@@ -15,2 +15,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

const vscode = require("vscode-languageserver-protocol");
const common_1 = require("../utils/common");
const dedupe = require("../utils/dedupe");

@@ -39,3 +40,3 @@ const featureWorkers_1 = require("../utils/featureWorkers");

for (const mapping of sourceMap.mappings) {
const overlapRange = shared.getOverlapRange2(offsetRange.start, offsetRange.end, mapping.sourceRange[0], mapping.sourceRange[1]);
const overlapRange = (0, common_1.getOverlapRange)(offsetRange.start, offsetRange.end, mapping.sourceRange[0], mapping.sourceRange[1]);
if (overlapRange) {

@@ -42,0 +43,0 @@ const start = (_a = sourceMap.toGeneratedOffset(overlapRange.start)) === null || _a === void 0 ? void 0 : _a[0];

Object.defineProperty(exports, "__esModule", { value: true });
exports.register = void 0;
const vscode = require("vscode-languageserver-protocol");
const shared = require("@volar/shared");
const featureWorkers_1 = require("../utils/featureWorkers");
const common_1 = require("../utils/common");
function register(context) {

@@ -20,3 +20,3 @@ return (uri, position) => {

contents: hovers.map(getHoverTexts).flat(),
range: (_b = (_a = hovers.find(hover => hover.range && shared.isInsideRange(hover.range, { start: position, end: position }))) === null || _a === void 0 ? void 0 : _a.range) !== null && _b !== void 0 ? _b : hovers[0].range,
range: (_b = (_a = hovers.find(hover => hover.range && (0, common_1.isInsideRange)(hover.range, { start: position, end: position }))) === null || _a === void 0 ? void 0 : _a.range) !== null && _b !== void 0 ? _b : hovers[0].range,
});

@@ -23,0 +23,0 @@ });

@@ -15,2 +15,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

const vscode = require("vscode-languageserver-protocol");
const common_1 = require("../utils/common");
const featureWorkers_1 = require("../utils/featureWorkers");

@@ -36,3 +37,3 @@ function register(context) {

for (const mapping of sourceMap.mappings) {
const overlapRange = shared.getOverlapRange2(offsetRange.start, offsetRange.end, mapping.sourceRange[0], mapping.sourceRange[1]);
const overlapRange = (0, common_1.getOverlapRange)(offsetRange.start, offsetRange.end, mapping.sourceRange[0], mapping.sourceRange[1]);
if (overlapRange) {

@@ -39,0 +40,0 @@ const start = (_a = sourceMap.toGeneratedOffset(overlapRange.start)) === null || _a === void 0 ? void 0 : _a[0];

@@ -12,4 +12,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

exports.register = void 0;
const shared_1 = require("@volar/shared");
const vscode = require("vscode-languageserver-protocol");
const common_1 = require("../utils/common");
const featureWorkers_1 = require("../utils/featureWorkers");

@@ -36,3 +36,3 @@ // https://github.com/microsoft/vscode/blob/dcf27391b7dd7c1cece483806af75b4f87188e70/extensions/html/language-configuration.json#L35

});
return result !== null && result !== void 0 ? result : (document ? (0, shared_1.getWordRange)(htmlWordPatterns, position, document) : undefined);
return result !== null && result !== void 0 ? result : (document ? (0, common_1.getWordRange)(htmlWordPatterns, position, document) : undefined);
});

@@ -39,0 +39,0 @@ }

{
"name": "@volar/language-service",
"version": "1.0.9",
"version": "1.0.10",
"main": "out/index.js",

@@ -16,10 +16,10 @@ "license": "MIT",

"dependencies": {
"@volar/language-core": "1.0.9",
"@volar/shared": "1.0.9",
"@volar/source-map": "1.0.9",
"@volar/transforms": "1.0.9",
"@volar/typescript-faster": "1.0.9",
"@vue/reactivity": "^3.2.40",
"vscode-html-languageservice": "^5.0.2",
"vscode-json-languageservice": "^5.1.1",
"@volar/language-core": "1.0.10",
"@volar/shared": "1.0.10",
"@volar/source-map": "1.0.10",
"@volar/transforms": "1.0.10",
"@volar/typescript-faster": "1.0.10",
"@vue/reactivity": "^3.2.45",
"vscode-html-languageservice": "^5.0.3",
"vscode-json-languageservice": "^5.1.3",
"vscode-languageserver-protocol": "^3.17.2",

@@ -29,3 +29,3 @@ "vscode-languageserver-textdocument": "^1.0.7",

},
"gitHead": "be2081f56ce4608324795b8a0ae83c288a3a784d"
"gitHead": "89b82f92fdc30674b03941c5f17c60df8c46211c"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc