Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .vscode-test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { defineConfig } from '@vscode/test-cli';

export default defineConfig({
files: 'client/out/test/**/*.test.js',
files: 'dist/client/out/test/**/*.test.js',
mocha: {
ui: 'tdd',
timeout: 4000
Expand Down
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"outFiles": ["${workspaceRoot}/client/out/**/*.js"],
"preLaunchTask": {
"type": "npm",
"script": "watch"
"script": "compile"
}
},
{
Expand Down Expand Up @@ -74,9 +74,9 @@
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/client/out/test/index"
"--extensionTestsPath=${workspaceFolder}/dist/client/out/test/index"
],
"outFiles": ["${workspaceFolder}/client/out/test/**/*.test.js"]
"outFiles": ["${workspaceFolder}/dist/client/out/test/**/*.test.js"]
}
],
"compounds": [
Expand Down
40 changes: 31 additions & 9 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,42 @@
]
},
{
"type": "npm",
"script": "watch",
"isBackground": true,
"label": "watch",
"dependsOn": [
"npm: watch:tsc",
"npm: watch:esbuild"
],
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
},
}
},
{
"type": "npm",
"script": "watch:esbuild",
"group": "build",
"problemMatcher": "$esbuild-watch",
"isBackground": true,
"label": "npm: watch:esbuild",
"presentation": {
"panel": "dedicated",
"group": "watch",
"reveal": "never"
},
"problemMatcher": [
"$tsc-watch"
]
}
},
{
"type": "npm",
"script": "watch:tsc",
"group": "build",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"label": "npm: watch:tsc",
"presentation": {
"group": "watch",
"reveal": "never"
}
}
]
}
16 changes: 4 additions & 12 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,13 @@ sample*/**
**/testFixture/**

# Node modules
node_modules/antlr4ng-cli/**
node_modules/**

# Client node modules
client/node_modules/**
!client/node_modules/vscode-jsonrpc/**
!client/node_modules/vscode-languageclient/**
!client/node_modules/vscode-languageserver-protocol/**
!client/node_modules/vscode-languageserver-types/**
!client/node_modules/{minimatch,brace-expansion,concat-map,balanced-match}/**
!client/node_modules/{semver,lru-cache,yallist}/**

# Server node modules
server/node_modules/**
!server/node_modules/vscode-jsonrpc/**
!server/node_modules/vscode-languageserver/**
!server/node_modules/vscode-languageserver-protocol/**
!server/node_modules/vscode-languageserver-textdocument/**
!server/node_modules/vscode-languageserver-types/**

# Extension bundle
!dist/**
Empty file removed client/out/placeholder.tmp
Empty file.
14 changes: 7 additions & 7 deletions client/package-lock.json

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

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"vscode-languageclient": "^9.0.1"
},
"devDependencies": {
"@types/vscode": "^1.96.0",
"@types/vscode": "^1.99.0",
"@vscode/test-electron": "^2.4.1"
}
}
2 changes: 1 addition & 1 deletion client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let client: LanguageClient;
export function activate(context: ExtensionContext) {
// The server is implemented in node
const serverModule = context.asAbsolutePath(
path.join('server', 'out', 'server.js')
path.join('dist', 'server', 'out', 'server.js')
);
// The debug options for the server
// --inspect=6009: runs the server in Node's Inspector mode so VS Code can attach to the server for debugging
Expand Down
9 changes: 8 additions & 1 deletion client/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ export interface LogMessage {

export class VscodeLogger {
private static _outputChannel: vscode.OutputChannel;
static get outputChannel(): vscode.OutputChannel {
private static get outputChannel(): vscode.OutputChannel {
if (!VscodeLogger._outputChannel) {
VscodeLogger._outputChannel = vscode.window.createOutputChannel('VBAPro Output');
VscodeLogger._outputChannel.show();
}
return VscodeLogger._outputChannel;
}
private static get configuredLevel(): LogLevel {
const config = vscode.workspace.getConfiguration('vbaLanguageServer');
const levelString = config.get<string>('logLevel.outputChannel', 'warning');
return LogLevel[levelString as keyof typeof LogLevel];
}

static info = (msg: string, lvl?: number) => this.log(LogLevel.info, msg, lvl)
static debug = (msg: string, lvl?: number) => this.log(LogLevel.debug, msg, lvl)
Expand All @@ -32,6 +37,8 @@ export class VscodeLogger {
}

private static log(type: LogLevel, msg: string, lvl?: number): void {
if (type > this.configuredLevel) return;

const i = '> '.repeat(lvl ?? 0);
const t = `${this.getFormattedTimestamp()}`;
VscodeLogger.outputChannel.appendLine(`${t} [${LogLevel[type]}] ${i}${msg}`);
Expand Down
2 changes: 1 addition & 1 deletion client/src/test/foldingRanges.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as vscode from 'vscode';
import * as assert from 'assert';
import { getDocUri, activate } from './helper';

suite('Should get text edits', () => {
suite('Should get folding ranges', () => {
test('formatting.class.template', async () => {
const subFoo = {start: 23, end: 42};
const subBar = {start: 44, end: 58};
Expand Down
2 changes: 1 addition & 1 deletion client/src/test/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function sleep(ms: number) {
}

export const getDocPath = (p: string) => {
return path.resolve(__dirname, '../../testFixture', p);
return path.resolve(__dirname, '../../../../test/fixtures', p);
};
export const getDocUri = (p: string) => {
return vscode.Uri.file(getDocPath(p));
Expand Down
4 changes: 2 additions & 2 deletions client/src/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as path from 'path';
import * as Mocha from 'mocha';
import Mocha from 'mocha';
import { glob } from 'glob';

export function run(): Promise<void> {
Expand All @@ -16,7 +16,7 @@ export function run(): Promise<void> {

const testsRoot = __dirname;

return glob.glob('**.test.js', { cwd: testsRoot }).then(async files => {
return glob.glob('**/*.test.js', { cwd: testsRoot }).then(async files => {

// Add files to the test suite
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
Expand Down
2 changes: 1 addition & 1 deletion client/src/test/runTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async function main() {

// The path to test runner
// Passed to --extensionTestsPath
const extensionTestsPath = path.resolve(__dirname, './index');
const extensionTestsPath = path.resolve(__dirname, '../../../dist/client/out/test/index.js');

// Download VS Code, unzip it and run the integration test
await runTests({ extensionDevelopmentPath, extensionTestsPath });
Expand Down
Loading