Skip to content

Commit

Permalink
refactor: remove extraPlugins arg for vue.createLanguageModules`vue…
Browse files Browse the repository at this point in the history
….createLanguageModules`
  • Loading branch information
johnsoncodehk committed Dec 31, 2022
1 parent a219c7f commit 74f6d33
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/vue-and-svelte-language-server/src/index.ts
Expand Up @@ -39,7 +39,7 @@ const plugin: LanguageServerPlugin<LanguageServerInitializationOptions, vue.Lang
},
syntacticService: {
getLanguageModules(ts) {
const vueLanguagePlugins = vue.getDefaultVueLanguagePlugins(ts, {}, {}, []);
const vueLanguagePlugins = vue.getDefaultVueLanguagePlugins(ts, {}, {});
const vueLanguageModule: LanguageModule = {
createFile(fileName, snapshot) {
if (fileName.endsWith('.vue')) {
Expand Down
4 changes: 1 addition & 3 deletions vue-language-tools/vue-language-core/src/languageModule.ts
Expand Up @@ -2,7 +2,7 @@ import type * as embedded from '@volar/language-core';
import { posix as path } from 'path';
import { getDefaultVueLanguagePlugins } from './plugins';
import { VueFile } from './sourceFile';
import { VueLanguagePlugin, VueCompilerOptions } from './types';
import { VueCompilerOptions } from './types';
import * as localTypes from './utils/localTypes';
import { resolveVueCompilerOptions } from './utils/ts';
import type * as ts from 'typescript/lib/tsserverlibrary';
Expand All @@ -11,15 +11,13 @@ export function createLanguageModules(
ts: typeof import('typescript/lib/tsserverlibrary'),
compilerOptions: ts.CompilerOptions,
_vueCompilerOptions: VueCompilerOptions,
extraPlugins: VueLanguagePlugin[] = [],
): embedded.LanguageModule[] {

const vueCompilerOptions = resolveVueCompilerOptions(_vueCompilerOptions);
const vueLanguagePlugin = getDefaultVueLanguagePlugins(
ts,
compilerOptions,
_vueCompilerOptions,
extraPlugins,
);

// from https://github.com/johnsoncodehk/volar/pull/1543
Expand Down
2 changes: 0 additions & 2 deletions vue-language-tools/vue-language-core/src/plugins.ts
Expand Up @@ -18,7 +18,6 @@ export function getDefaultVueLanguagePlugins(
ts: typeof import('typescript/lib/tsserverlibrary'),
compilerOptions: ts.CompilerOptions,
_vueCompilerOptions: VueCompilerOptions,
extraPlugins: VueLanguagePlugin[] = [],
) {

const _plugins: VueLanguagePlugin[] = [
Expand All @@ -31,7 +30,6 @@ export function getDefaultVueLanguagePlugins(
useVueSfcScriptsFormat,
useVueSfcTemplate,
useVueTsx,
...extraPlugins,
];
const pluginPaths = new Map<number, string>();
const vueCompilerOptions = resolveVueCompilerOptions(_vueCompilerOptions);
Expand Down
Expand Up @@ -107,7 +107,7 @@ const plugin: LanguageServerPlugin<VueServerInitializationOptions, vue.LanguageS
syntacticService: {
getLanguageModules(ts) {
const vueOptions: vue.VueCompilerOptions = { extensions: getVueExts(['.vue']) };
const vueLanguagePlugins = vue2.getDefaultVueLanguagePlugins(ts, {}, vueOptions, []);
const vueLanguagePlugins = vue2.getDefaultVueLanguagePlugins(ts, {}, vueOptions);
const vueLanguageModule: embedded.LanguageModule = {
createFile(fileName, snapshot) {
if (vueOptions.extensions?.some(ext => fileName.endsWith(ext))) {
Expand Down

0 comments on commit 74f6d33

Please sign in to comment.