@vue/typescript-plugin
Advanced tools
Comparing version 2.0.10 to 2.0.11
@@ -45,3 +45,3 @@ "use strict"; | ||
(0, common_1.decorateLanguageServiceForVue)(language, info.languageService, vueOptions, ts, true); | ||
(0, decorateLanguageServiceHost_1.decorateLanguageServiceHost)(ts, language, info.languageServiceHost, getLanguageId); | ||
(0, decorateLanguageServiceHost_1.decorateLanguageServiceHost)(ts, language, info.languageServiceHost); | ||
(0, server_1.startNamedPipeServer)(ts, info.project.projectKind, info.project.getCurrentDirectory()); | ||
@@ -48,0 +48,0 @@ } |
@@ -70,3 +70,3 @@ "use strict"; | ||
async function sendRequest(request) { | ||
const server = await (0, utils_1.searchNamedPipeServerForFile)(request.args[0]); | ||
const server = (await (0, utils_1.searchNamedPipeServerForFile)(request.args[0]))?.server; | ||
if (!server) { | ||
@@ -73,0 +73,0 @@ console.warn('[Vue Named Pipe Client] No server found for', request.args[0]); |
import type * as ts from 'typescript'; | ||
import type { Language, VueCompilerOptions } from '@vue/language-core'; | ||
export interface Request { | ||
type: 'containsFile' | 'collectExtractProps' | 'getImportPathForFile' | 'getPropertiesAtLocation' | 'getQuickInfoAtPosition' | 'getComponentProps' | 'getComponentEvents' | 'getTemplateContextProps' | 'getComponentNames' | 'getElementAttrs'; | ||
type: 'projectInfoForFile' | 'collectExtractProps' | 'getImportPathForFile' | 'getPropertiesAtLocation' | 'getQuickInfoAtPosition' | 'getComponentProps' | 'getComponentEvents' | 'getTemplateContextProps' | 'getComponentNames' | 'getElementAttrs'; | ||
args: [fileName: string, ...rest: any]; | ||
@@ -6,0 +6,0 @@ } |
@@ -27,4 +27,9 @@ "use strict"; | ||
const project = getProject(fileName); | ||
if (request.type === 'containsFile') { | ||
connection.write(JSON.stringify(!!project)); | ||
if (request.type === 'projectInfoForFile') { | ||
connection.write(JSON.stringify(project | ||
? { | ||
name: project.info.project.getProjectName(), | ||
kind: project.info.project.projectKind, | ||
} | ||
: undefined)); | ||
} | ||
@@ -31,0 +36,0 @@ else if (project) { |
@@ -13,3 +13,12 @@ /// <reference types="node" /> | ||
export declare function connect(path: string): Promise<net.Socket | undefined>; | ||
export declare function searchNamedPipeServerForFile(fileName: string): Promise<NamedPipeServer | undefined>; | ||
export declare function searchNamedPipeServerForFile(fileName: string): Promise<{ | ||
server: NamedPipeServer; | ||
projectInfo: { | ||
name: string; | ||
kind: ts.server.ProjectKind; | ||
}; | ||
} | { | ||
server: NamedPipeServer; | ||
projectInfo: undefined; | ||
} | undefined>; | ||
export declare function sendRequestWorker<T>(request: Request, client: net.Socket): Promise<T | null | undefined>; |
@@ -55,5 +55,8 @@ "use strict"; | ||
if (client) { | ||
const response = await sendRequestWorker({ type: 'containsFile', args: [fileName] }, client); | ||
if (response) { | ||
return server; | ||
const projectInfo = await sendRequestWorker({ type: 'projectInfoForFile', args: [fileName] }, client); | ||
if (projectInfo) { | ||
return { | ||
server, | ||
projectInfo, | ||
}; | ||
} | ||
@@ -66,3 +69,6 @@ } | ||
if (client) { | ||
return server; | ||
return { | ||
server, | ||
projectInfo: undefined, | ||
}; | ||
} | ||
@@ -69,0 +75,0 @@ } |
{ | ||
"name": "@vue/typescript-plugin", | ||
"version": "2.0.10", | ||
"version": "2.0.11", | ||
"license": "MIT", | ||
@@ -15,4 +15,4 @@ "files": [ | ||
"dependencies": { | ||
"@volar/typescript": "~2.2.0-alpha.5", | ||
"@vue/language-core": "2.0.10", | ||
"@volar/typescript": "~2.2.0-alpha.6", | ||
"@vue/language-core": "2.0.11", | ||
"@vue/shared": "^3.4.0" | ||
@@ -23,3 +23,3 @@ }, | ||
}, | ||
"gitHead": "a20a2ee950b63a949660b7e8faf0faed0e5bad33" | ||
"gitHead": "c89f25ffc32c760130adeeac796b9a5d20585bf7" | ||
} |
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
48521
1032
+ Added@vue/language-core@2.0.11(transitive)
- Removed@vue/language-core@2.0.10(transitive)
Updated@vue/language-core@2.0.11