Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get context help working and fixup path problems with kernel tree #18

Merged
merged 4 commits into from
Apr 22, 2022
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
103 changes: 53 additions & 50 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,70 @@
name: Build and Test

permissions:
deployments: write
deployments: write

on:
pull_request:
branches:
- main
workflow_dispatch:
pull_request:
branches:
- main
workflow_dispatch:

env:
NODE_VERSION: 14.16.0
IS_CI: 1
NODE_VERSION: 16.13.0
IS_CI: 1

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Use Node ${{env.NODE_VERSION}}
uses: actions/[email protected]
with:
node-version: ${{env.NODE_VERSION}}
- name: Use Node ${{env.NODE_VERSION}}
uses: actions/[email protected]
with:
node-version: ${{env.NODE_VERSION}}

- run: npm install
name: npm install
- run: npm install
name: npm install

- run: npm run compile
name: npm run compile
- run: npm run compile
name: npm run compile

test:
timeout-minutes: 30
name: Tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
- run: npm run compile-webviews
name: npm run compile-webviews

- name: Use Node ${{env.NODE_VERSION}}
uses: actions/[email protected]
with:
node-version: ${{env.NODE_VERSION}}
test:
timeout-minutes: 30
name: Tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v2

- run: npm install
name: npm install
- name: Use Node ${{env.NODE_VERSION}}
uses: actions/[email protected]
with:
node-version: ${{env.NODE_VERSION}}

- run: npm run compile
name: npm run compile
- run: npm install
name: npm install

- run: npm run test-compile
name: npm run test-compile

- name: Run tests using xvfb
env:
DISPLAY: 10
uses: GabrielBB/[email protected]
id: test_id
with:
run: npm run test
- run: npm run compile
name: npm run compile

- run: npm run compile-tests
name: npm run compile-tests

- name: Run tests using xvfb
env:
DISPLAY: 10
uses: GabrielBB/[email protected]
id: test_id
with:
run: npm run test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ out
node_modules
vscode.d.ts
vscode.*.d.ts
.vscode-test
63 changes: 22 additions & 41 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,26 @@
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--enable-proposed-api"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
},
{
"name": "Run Extension (with deemon)",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}", "--enable-proposed-api"
],
"skipFiles": ["<node_internals>/**"],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
]
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "npm: test-compile"
}
]
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "--enable-proposed-api"],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"preLaunchTask": "Compile"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": ["${workspaceFolder}/out/test/**/*.js"],
"preLaunchTask": "npm: watch-tests"
}
]
}
64 changes: 46 additions & 18 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,50 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"group": { "kind": "build", "isDefault": true },
"problemMatcher": "$esbuild-watch",
"isBackground": true,
"label": "npm: watch",
},
{
"type": "npm",
"script": "build",
"group": "build",
"problemMatcher": "$esbuild",
"label": "npm: build",
}
]
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"tasks": [
{
"label": "Compile",
"type": "npm",
"script": "watch",
"isBackground": true,
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": ["$tsc-watch", "$ts-checker-webpack-watch"]
},
{
"label": "Compile Web Views",
"type": "npm",
"script": "compile-webviews-watch",
"isBackground": true,
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": ["$tsc-watch", "$ts-checker-webpack-watch"]
},
{
"type": "npm",
"script": "watch-tests",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": "build"
},
{
"label": "tasks: watch-tests",
"dependsOn": ["npm: watch", "npm: watch-tests"],
"problemMatcher": []
}
]
}
8 changes: 8 additions & 0 deletions build/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';

const util = require('./util');
exports.ExtensionRootDir = util.ExtensionRootDir;
exports.isWindows = /^win/.test(process.platform);
exports.isCI = process.env.TF_BUILD !== undefined || process.env.GITHUB_ACTIONS === 'true';
19 changes: 19 additions & 0 deletions build/util.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';

const fs = require('fs');
const path = require('path');
exports.ExtensionRootDir = path.dirname(__dirname);
function getListOfFiles(filename) {
filename = path.normalize(filename);
if (!path.isAbsolute(filename)) {
filename = path.join(__dirname, filename);
}
const data = fs.readFileSync(filename).toString();
const files = JSON.parse(data);
return files.map((file) => {
return path.join(exports.ExtensionRootDir, file.replace(/\//g, path.sep));
});
}
exports.getListOfFiles = getListOfFiles;
49 changes: 49 additions & 0 deletions build/webpack/common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';

const constants = require('../constants');
const glob = require('glob');
const path = require('path');
const webpack_bundle_analyzer = require('webpack-bundle-analyzer');
exports.nodeModulesToExternalize = [
'unicode/category/Lu',
'unicode/category/Ll',
'unicode/category/Lt',
'unicode/category/Lo',
'unicode/category/Lm',
'unicode/category/Nl',
'unicode/category/Mn',
'unicode/category/Mc',
'unicode/category/Nd',
'unicode/category/Pc',
'@jupyterlab/services',
'request',
'request-progress',
'diff-match-patch',
'node-stream-zip',
'vsls/vscode',
'pdfkit/js/pdfkit.standalone',
'crypto-js',
'fontkit',
'png-js',
'zeromq'
];
exports.nodeModulesToReplacePaths = [...exports.nodeModulesToExternalize];
function getDefaultPlugins(name) {
const plugins = [];
// Only run the analyzer on a local machine or if required
if (!constants.isCI || process.env.VSC_JUPYTER_FORCE_ANALYZER) {
plugins.push(
new webpack_bundle_analyzer.BundleAnalyzerPlugin({
analyzerMode: 'static',
reportFilename: `${name}.analyzer.html`,
generateStatsFile: true,
statsFilename: `${name}.stats.json`,
openAnalyzer: false // Open file manually if you want to see it :)
})
);
}
return plugins;
}
exports.getDefaultPlugins = getDefaultPlugins;
24 changes: 24 additions & 0 deletions build/webpack/loaders/externalizeDependencies.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

const common = require('../common');
function replaceModule(prefixRegex, prefix, contents, moduleName, quotes) {
const stringToSearch = `${prefixRegex}${quotes}${moduleName}${quotes}`;
const stringToReplaceWith = `${prefix}${quotes}./node_modules/${moduleName}${quotes}`;
return contents.replace(new RegExp(stringToSearch, 'gm'), stringToReplaceWith);
}
// tslint:disable:no-default-export no-invalid-this
function default_1(source) {
common.nodeModulesToReplacePaths.forEach((moduleName) => {
if (source.indexOf(moduleName) > 0) {
source = replaceModule('import\\(', 'import(', source, moduleName, '"');
source = replaceModule('import\\(', 'import(', source, moduleName, "'");
source = replaceModule('require\\(', 'require(', source, moduleName, '"');
source = replaceModule('require\\(', 'require(', source, moduleName, "'");
source = replaceModule('from ', 'from ', source, moduleName, '"');
source = replaceModule('from ', 'from ', source, moduleName, "'");
}
});
return source;
}
exports.default = default_1;
Loading