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

[VsCoq1] Webpack Client and Server #266

Closed
wants to merge 1 commit into from
Closed
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ backup.sh
start-env.ps1
**/npm-debug.log
*.tsbuildinfo
*.vsix
12 changes: 6 additions & 6 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@
"name": "Launch Client",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
"outFiles": ["${workspaceRoot}/out/client/**/*.js"],
"preLaunchTask": {
"type": "npm",
"script": "compile"
}
"outFiles": ["${workspaceRoot}/client/out/**/*.js"],
"sourceMaps": true,
"preLaunchTask": "npm: watch" //The new vscode window still needs to be reloaded after changes (Ctrl+Shift+F5 in the debugger)
},
{
"type": "node",
"request": "attach",
"protocol": "inspector",
"address": "localhost",
"name": "Attach to Server",
"port": 6009,
"restart": true,
"outFiles": ["${workspaceRoot}/out/server/**/*.js"]
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/server/out/**/*.js"]
}
],
"compounds": [
Expand Down
18 changes: 14 additions & 4 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,24 @@
"tasks": [
{
"type": "npm",
"script": "compile",
"script": "watch",
"promptOnClose": true,
"isBackground": true,
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$tsc"
]
"presentation": {
"reveal": "never",
"panel": "dedicated"
},
"problemMatcher": "$ts-webpack-watch",
},
{
"type": "npm",
"script": "compile",
"group": "build",
"problemMatcher": "$ts-webpack-watch",
},
]
}
32 changes: 23 additions & 9 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
**/.gitignore
shared.webpack.config.js
webpack.*.config.js
**/*.ts
**/*.map
**/webpack.config.js
**/tsconfig.json
**/tsconfig.base.json
**/tslint.json
.vscode/**
out/client/test/**
node_modules
tsconfig.tsbuildinfo


# The client is partially web packed. So only ship extension.js
client/test/**
client/src/**
client/server/installServerIntoExtension.cmd
client/server/installServerIntoExtension
client/**/*.map
.gitignore
client/tsconfig.json
client/out/**
!client/out/extension.js

# The html_views are partially web packed.
html_views/src
html_views/typing

# The server is web packed. So only ship server.js
server/**
html_views/**
out/**/*.js.map
out/server/test
!server/out/server.js
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
world: compile
world: node_modules
node_modules/.bin/vsce package

clean:
rm -rf node_modules out
rm -rf node_modules client/out server/out html_views/out

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line can be replaced by a terse git clean -dfx, if the .gitignore is correct.


node_modules:
node_modules: package.json
npm install

compile: node_modules
Expand Down
2 changes: 1 addition & 1 deletion client/src/CoqLanguageServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class CoqLanguageServer implements vscode.Disposable {

private constructor(context: ExtensionContext) {
// The server is implemented in node
let serverModule = context.asAbsolutePath(path.join('out', 'server', 'src', 'server.js'));
let serverModule = context.asAbsolutePath(path.join('server', 'out', 'server.js'));
// The debug options for the server
let debugOptions = ["--nolazy", "--inspect=6009"];

Expand Down
6 changes: 3 additions & 3 deletions client/src/Decorations.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';
import * as vscode from 'vscode';

const STM_FOCUS_IMAGE = "out/images/stm-focus.svg";
const STM_FOCUS_IMAGE_BEFORE = "out/images/stm-focus-before.svg";
const STM_FOCUS_IMAGE_PROOF_VIEW = "out/images/stm-focus-proof-view.svg";
const STM_FOCUS_IMAGE = "client/images/stm-focus.svg";
const STM_FOCUS_IMAGE_BEFORE = "client/images/stm-focus-before.svg";
const STM_FOCUS_IMAGE_PROOF_VIEW = "client/images/stm-focus-proof-view.svg";

interface DecorationsInternal extends Decorations {
parsing: vscode.TextEditorDecorationType;
Expand Down
8 changes: 4 additions & 4 deletions client/src/HtmlCoqView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type ProofViewProtocol = GoalUpdate | SettingsUpdate;
const VIEW_PATH = 'html_views';

function proofViewFile(file: string = "") {
return vscode.Uri.file(extensionContext.asAbsolutePath(path.join('out', VIEW_PATH, file)));
return vscode.Uri.file(extensionContext.asAbsolutePath(path.join(VIEW_PATH, 'static', file)));
}

function proofViewHtmlPath() {
Expand Down Expand Up @@ -131,7 +131,7 @@ export class HtmlCoqView implements view.CoqView {
},
{
enableScripts: true,
localResourceRoots: [vscode.Uri.file(path.join(extensionContext.extensionPath, 'out', VIEW_PATH))]
localResourceRoots: [vscode.Uri.file(path.join(extensionContext.extensionPath, VIEW_PATH))]
}
);

Expand All @@ -142,10 +142,10 @@ export class HtmlCoqView implements view.CoqView {

let doc = await vscode.workspace.openTextDocument(this.coqViewUri);

let csspath = path.join(extensionContext.extensionPath, 'out', VIEW_PATH, 'proof-view.css');
let csspath = path.join(extensionContext.extensionPath, VIEW_PATH, 'static', 'proof-view.css');
let csspasthAsVscodeResource = this.panel.webview.asWebviewUri(vscode.Uri.file(csspath));

let jspath = path.join(extensionContext.extensionPath, 'out', VIEW_PATH, 'goals.js');
let jspath = path.join(extensionContext.extensionPath, VIEW_PATH, 'out', 'goals.js');
let jspathAsVscodeResource = this.panel.webview.asWebviewUri(vscode.Uri.file(jspath));

this.panel.webview.html = mustache.render(doc.getText(), {
Expand Down
9 changes: 8 additions & 1 deletion client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"extends": "../tsconfig",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "out",
"tsBuildInfoFile": "out/tsconfig.tsBuildInfoFile",
"rootDir": "src",
"lib": ["es6", "dom"],
"sourceMap": true,
"composite": true,
"forceConsistentCasingInFileNames": true,
"noImplicitAny": true,
Expand Down
4 changes: 2 additions & 2 deletions html_views/src/ltacprof/ltacprof.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,11 @@ function updateResults() {
});
$('#local-column').on("click",(ev:JQueryEventObject) => {
if(ev.target === $('#local-column').get(0))
$('#local-unit option:selected').prop('selected',false).cycleNext().prop('selected', true); $('#local-unit').change()
($('#local-unit option:selected').prop('selected',false) as any).cycleNext().prop('selected', true); $('#local-unit').change()
});
$('#total-column').on("click",(ev:JQueryEventObject) => {
if(ev.target === $('#total-column').get(0))
$('#total-unit option:selected').prop('selected',false).cycleNext().prop('selected', true); $('#total-unit').change()
($('#total-unit option:selected').prop('selected',false) as any).cycleNext().prop('selected', true); $('#total-unit').change()
});
}
loadResultsTable(currentResults, tbody);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 4 additions & 2 deletions html_views/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"extends": "../tsconfig",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "../out/html_views",
"outDir": "out",
"tsBuildInfoFile": "out/tsconfig.tsBuildInfoFile",
"rootDir": "src",
"forceConsistentCasingInFileNames": true,
"noImplicitAny": true,
"noImplicitReturns": true
Expand Down
Loading