Skip to content

Commit ecd842e

Browse files
authored
Merge pull request #44 from admvx/comment-sanitization
Comment sanitization fix + extension build upgrades
2 parents e08a2b9 + 1c05fe2 commit ecd842e

20 files changed

+318
-226
lines changed

.eslintignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

.vscode/launch.json

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
11
// A launch configuration that compiles the extension and then opens it inside a new window
22
{
3-
"version": "0.2.0",
4-
"configurations": [
5-
{
6-
"type": "extensionHost",
7-
"request": "launch",
8-
"name": "Launch Client",
9-
"runtimeExecutable": "${execPath}",
10-
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
11-
"outFiles": ["${workspaceRoot}/client/out/**/*.js"],
12-
"preLaunchTask": {
13-
"type": "npm",
14-
"script": "watch"
15-
},
16-
"sourceMaps": true
17-
},
18-
{
19-
"type": "node",
20-
"request": "attach",
21-
"name": "Attach to Server",
22-
"port": 6009,
23-
"restart": true,
24-
"outFiles": ["${workspaceRoot}/server/out/**/*.js"],
25-
"sourceMaps": true
26-
}
27-
],
28-
"compounds": [
29-
{
30-
"name": "Client + Server",
31-
"configurations": ["Launch Client", "Attach to Server"]
32-
}
33-
]
3+
"version": "0.2.0",
4+
"configurations": [
5+
{
6+
"type": "extensionHost",
7+
"request": "launch",
8+
"name": "Launch Client",
9+
"runtimeExecutable": "${execPath}",
10+
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
11+
"outFiles": ["${workspaceRoot}/client/out/**/*.js"],
12+
"preLaunchTask": "Watch",
13+
"postDebugTask": "Terminate watch",
14+
"sourceMaps": true
15+
},
16+
{
17+
"type": "node",
18+
"request": "attach",
19+
"name": "Attach to Server",
20+
"port": 6009,
21+
"restart": true,
22+
"timeout": 30000,
23+
"outFiles": ["${workspaceRoot}/server/out/**/*.js"],
24+
"sourceMaps": true
25+
}
26+
],
27+
"compounds": [
28+
{
29+
"name": "Client + Server",
30+
"configurations": ["Launch Client", "Attach to Server"]
31+
}
32+
]
3433
}

.vscode/settings.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"files.exclude": {
3-
"out": false // set this to true to hide the "out" folder with the compiled JS files
4-
},
5-
"search.exclude": {
6-
"out": true // set this to false to include "out" folder in search results
7-
},
8-
"typescript.tsdk": "./node_modules/typescript/lib",
9-
"typescript.tsc.autoDetect": "off",
10-
"npm.exclude": ["client", "server"],
11-
"npm.enableScriptExplorer": true
12-
}
2+
"files.exclude": {
3+
"out": false // set this to true to hide the "out" folder with the compiled JS files
4+
},
5+
"search.exclude": {
6+
"out": true // set this to false to include "out" folder in search results
7+
},
8+
"typescript.tsdk": "./node_modules/typescript/lib",
9+
"typescript.tsc.autoDetect": "off",
10+
"npm.exclude": ["client", "server"],
11+
"npm.enableScriptExplorer": true
12+
}

.vscode/tasks.json

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,7 @@
22
"version": "2.0.0",
33
"tasks": [
44
{
5-
"type": "npm",
6-
"script": "compile",
7-
"group": "build",
8-
"presentation": {
9-
"panel": "dedicated",
10-
"reveal": "never"
11-
},
12-
"problemMatcher": [
13-
"$tsc"
14-
]
15-
},
16-
{
5+
"label": "Watch",
176
"type": "npm",
187
"script": "watch",
198
"isBackground": true,
@@ -23,11 +12,38 @@
2312
},
2413
"presentation": {
2514
"panel": "dedicated",
26-
"reveal": "never"
15+
"reveal": "silent"
2716
},
28-
"problemMatcher": [
29-
"$tsc-watch"
30-
]
17+
"problemMatcher": {
18+
"owner": "typescript",
19+
"source": "ts",
20+
"applyTo": "closedDocuments",
21+
"fileLocation": "absolute",
22+
"severity": "error",
23+
"pattern": [
24+
{ "regexp": "\\[tsl\\] (ERROR|WARNING) in (.*)?\\((\\d+),(\\d+)\\)", "severity": 1, "file": 2, "line": 3, "column": 4 },
25+
{ "regexp": "\\s*TS(\\d+):\\s*(.*)$", "code": 1, "message": 2 }
26+
],
27+
"background": {
28+
"activeOnStart": true,
29+
"beginsPattern": { "regexp": "[Cc]ompiling.*?|[Cc]ompil(ation|er) .*?starting" },
30+
"endsPattern": { "regexp": "[Cc]ompiled (.*?successfully|with .*?error)|[Cc]ompil(ation|er) .*?finished" }
31+
}
32+
}
33+
},
34+
{
35+
"label": "Terminate watch",
36+
"command": "echo ${input:terminate}",
37+
"type": "shell",
38+
"problemMatcher": []
39+
}
40+
],
41+
"inputs": [
42+
{
43+
"id": "terminate",
44+
"type": "command",
45+
"command": "workbench.action.tasks.terminate",
46+
"args": "terminateAll"
3147
}
3248
]
3349
}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Updates to the AS2 Language Support project will be documented here as new versions are released.
44

5+
## [1.3.4](https://github.com/admvx/as2-language-support/compare/v1.3.3...v1.3.4) - 2021-10-30
6+
- Fix an issue with block comment sanitization consuming one character too many, leading to parse errors
7+
- Refactor extension build tooling, and fix breakpoints in debug sessions
8+
59
## [1.3.3](https://github.com/admvx/as2-language-support/compare/v1.3.2...v1.3.3) - 2020-07-06
610
Maintenance update:
711
- Add initial unit tests (around ~40% code coverage so far)

base.webpack.config.js

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,31 @@
11
'use strict';
22

3-
const path = require('path');
43
const merge = require('merge-options');
54

6-
module.exports = function withDefaults(extConfig) {
7-
let defaultConfig = {
8-
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
9-
target: 'node', // extensions run in a node context
10-
node: {
11-
__dirname: false // leave the __dirname-behaviour intact
12-
},
13-
resolve: {
14-
mainFields: ['module', 'main'],
15-
extensions: ['.ts', '.js'] // support ts-files and js-files
16-
},
5+
module.exports = function extendBaseConfig(subConfig) {
6+
let baseConfig = {
7+
mode: 'none', // The npm task `compile` overrides this to 'production' mode via webpack-cli
8+
target: 'node',
9+
resolve: { extensions: ['.ts', '.js'] },
1710
module: {
1811
rules: [{
1912
test: /\.ts$/,
2013
exclude: /node_modules/,
2114
use: [{
22-
// configure TypeScript loader:
23-
// * enable sources maps for end-to-end source maps
2415
loader: 'ts-loader',
2516
options: {
26-
compilerOptions: {
27-
"sourceMap": true,
28-
}
17+
compilerOptions: { sourceMap: true } // Maps are excluded from the extension bundle
2918
}
3019
}]
3120
}]
3221
},
33-
externals: {
34-
'vscode': 'commonjs vscode', // ignored because it doesn't exist
35-
},
22+
externals: { vscode: 'commonjs vscode' },
3623
output: {
37-
// all output goes into `dist`.
38-
// packaging depends on that and this must always be like it
39-
filename: '[name].js',
40-
path: path.join(extConfig.context, 'out'),
41-
libraryTarget: "commonjs",
24+
libraryTarget: 'commonjs',
25+
devtoolModuleFilenameTemplate: 'file:///[absolute-resource-path]'
4226
},
43-
// yes, really source maps
4427
devtool: 'source-map'
4528
};
4629

47-
return merge(defaultConfig, extConfig);
48-
};
30+
return merge(baseConfig, subConfig);
31+
};

client/tsconfig.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
{
2-
"compilerOptions": {
3-
"module": "commonjs",
4-
"target": "es2019",
5-
"outDir": "out",
6-
"rootDir": "src",
7-
"lib": ["ES2019"],
8-
"sourceMap": true,
9-
"skipLibCheck": true
10-
},
11-
"include": ["src"],
12-
"exclude": ["node_modules", ".vscode-test"]
13-
}
1+
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"target": "es2019",
5+
"outDir": "out",
6+
"rootDir": "src",
7+
"lib": ["ES2019"],
8+
"sourceMap": true,
9+
"skipLibCheck": true
10+
},
11+
"include": ["src"],
12+
"exclude": ["node_modules", ".vscode-test"]
13+
}

client/webpack.config.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ const withDefaults = require('../base.webpack.config');
44
const path = require('path');
55

66
module.exports = withDefaults({
7-
context: path.join(__dirname),
8-
entry: {
9-
extension: './src/extension.ts',
10-
},
7+
context: __dirname,
8+
entry: { extension: './src/extension.ts' },
119
output: {
1210
filename: 'extension.js',
1311
path: path.join(__dirname, 'out')

dual.webpack.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
'use strict';
2+
3+
const clientConfig = require('./client/webpack.config');
4+
const serverConfig = require('./server/webpack.config');
5+
6+
module.exports = [clientConfig, serverConfig];

0 commit comments

Comments
 (0)