-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use prettier to format all file
- Loading branch information
Showing
71 changed files
with
3,449 additions
and
2,767 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
const path = require('path'); | ||
const path = require("path"); | ||
|
||
module.exports = { | ||
babelConfig: path.resolve(__dirname, './babel.config.js'), | ||
mainjs: path.resolve(__dirname, '../src/extension.ts'), | ||
build: path.resolve(__dirname, '../outExtension'), | ||
src: path.resolve(__dirname, '../src'), | ||
babelConfig: path.resolve(__dirname, "./babel.config.js"), | ||
mainjs: path.resolve(__dirname, "../src/extension.ts"), | ||
build: path.resolve(__dirname, "../outExtension"), | ||
src: path.resolve(__dirname, "../src"), | ||
config: path.resolve(__dirname), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
const paths = require('./paths'); | ||
const paths = require("./paths"); | ||
module.exports = { | ||
mode: 'development', | ||
target: 'node', | ||
mode: "development", | ||
target: "node", | ||
node: { | ||
__dirname: false, | ||
__filename: false, | ||
}, | ||
entry: paths.mainjs, | ||
output: { | ||
path: paths.build, | ||
filename: 'extension.js', | ||
libraryTarget: 'commonjs2' | ||
filename: "extension.js", | ||
libraryTarget: "commonjs2", | ||
}, | ||
externals: { | ||
vscode: 'commonjs vscode' // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/ | ||
vscode: "commonjs vscode", // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/ | ||
}, | ||
// loader | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.ts$/, | ||
exclude: /node_modules/, | ||
loader: 'ts-loader' | ||
} | ||
] | ||
loader: "ts-loader", | ||
}, | ||
], | ||
}, | ||
resolve: { | ||
extensions: ['.ts', '.js', '.json'] | ||
extensions: [".ts", ".js", ".json"], | ||
}, | ||
plugins: [], | ||
devtool: 'source-map' | ||
devtool: "source-map", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
process.env.NODE_ENV = 'production'; | ||
const utils = require('../utils/utils'); | ||
const paths = require('../config/paths'); | ||
const config = require('../config/webpack.config'); | ||
const { buildSources } = utils | ||
process.env.NODE_ENV = "production"; | ||
const utils = require("../utils/utils"); | ||
const paths = require("../config/paths"); | ||
const config = require("../config/webpack.config"); | ||
const { buildSources } = utils; | ||
|
||
buildSources(config, paths.build) | ||
buildSources(config, paths.build); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
process.env.NODE_ENV = 'development'; | ||
const utils = require('../utils/utils'); | ||
const paths = require('../config/paths'); | ||
const config = require('../config/webpack.config'); | ||
const { watchSources } = utils | ||
process.env.NODE_ENV = "development"; | ||
const utils = require("../utils/utils"); | ||
const paths = require("../config/paths"); | ||
const config = require("../config/webpack.config"); | ||
const { watchSources } = utils; | ||
|
||
watchSources(config, paths.build) | ||
watchSources(config, paths.build); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,64 @@ | ||
import * as vscode from 'vscode'; | ||
import { getDependencyTreeData } from './data-dependencyTree/data-dependencyTree'; | ||
import { createView } from './web-dependencyTree/openWebView'; | ||
import { postMessageCatchError } from './utils/message/postMessageToWebView'; | ||
import { reOpenWebView } from './web-dependencyTree/openWebView'; | ||
import { renderTreeView } from './view-dependencyTree/renderTreeView'; | ||
import * as vscode from "vscode"; | ||
import { getDependencyTreeData } from "./data-dependencyTree/data-dependencyTree"; | ||
import { createView } from "./web-dependencyTree/openWebView"; | ||
import { postMessageCatchError } from "./utils/message/postMessageToWebView"; | ||
import { reOpenWebView } from "./web-dependencyTree/openWebView"; | ||
import { renderTreeView } from "./view-dependencyTree/renderTreeView"; | ||
import { | ||
MESSAGE_DEPENDENCY_TREE_DATA, | ||
MESSAGE_FOCUS_ON_NODE, | ||
MESSAGE_UPDATE_WEBVIEW | ||
} from './utils/message/messagesKeys'; | ||
import * as stringRandom from 'string-random'; | ||
MESSAGE_DEPENDENCY_TREE_DATA, | ||
MESSAGE_FOCUS_ON_NODE, | ||
MESSAGE_UPDATE_WEBVIEW, | ||
} from "./utils/message/messagesKeys"; | ||
import * as stringRandom from "string-random"; | ||
|
||
let message = 0; | ||
|
||
export const command_createView = vscode.commands.registerCommand('framegraph.createView', () => { | ||
createView(); | ||
}); | ||
export const command_createView = vscode.commands.registerCommand( | ||
"framegraph.createView", | ||
() => { | ||
createView(); | ||
} | ||
); | ||
|
||
// export const command_postMessage = vscode.commands.registerCommand('framegraph.postMessage', () => { | ||
// postMessageCatchError({ key: 'postMessageTest', value: message++ }); | ||
// }); | ||
|
||
export const command_focusOnNode = vscode.commands.registerCommand('framegraph.focusOnNode', (fileName, fileData) => { | ||
postMessageCatchError({ key: MESSAGE_FOCUS_ON_NODE, value: { fileName, fileData } }); | ||
}); | ||
export const command_reOpenView = vscode.commands.registerCommand('framegraph.reOpenView', (fileName, fileData) => { | ||
reOpenWebView(global.dependencyTreeData); | ||
}); | ||
export const command_refreshFile = vscode.commands.registerCommand('framegraph.refreshFile', (fileName, fileData) => { | ||
// no catch error may be webview is closed | ||
let postMessage = false; | ||
if (global.webViewPanel) { | ||
postMessage = true; | ||
postMessageCatchError({ key: MESSAGE_UPDATE_WEBVIEW, value: stringRandom() }); | ||
} | ||
global.dependencyTreeData = getDependencyTreeData(postMessage); | ||
renderTreeView(global.dependencyTreeData); | ||
if (global.webViewPanel) { | ||
postMessageCatchError({ key: MESSAGE_DEPENDENCY_TREE_DATA, value: global.dependencyTreeData }); | ||
} | ||
}); | ||
export const allCommands = [ command_createView, command_reOpenView ]; | ||
export const command_focusOnNode = vscode.commands.registerCommand( | ||
"framegraph.focusOnNode", | ||
(fileName, fileData) => { | ||
postMessageCatchError({ | ||
key: MESSAGE_FOCUS_ON_NODE, | ||
value: { fileName, fileData }, | ||
}); | ||
} | ||
); | ||
export const command_reOpenView = vscode.commands.registerCommand( | ||
"framegraph.reOpenView", | ||
(fileName, fileData) => { | ||
reOpenWebView(global.dependencyTreeData); | ||
} | ||
); | ||
export const command_refreshFile = vscode.commands.registerCommand( | ||
"framegraph.refreshFile", | ||
(fileName, fileData) => { | ||
// no catch error may be webview is closed | ||
let postMessage = false; | ||
if (global.webViewPanel) { | ||
postMessage = true; | ||
postMessageCatchError({ | ||
key: MESSAGE_UPDATE_WEBVIEW, | ||
value: stringRandom(), | ||
}); | ||
} | ||
global.dependencyTreeData = getDependencyTreeData(postMessage); | ||
renderTreeView(global.dependencyTreeData); | ||
if (global.webViewPanel) { | ||
postMessageCatchError({ | ||
key: MESSAGE_DEPENDENCY_TREE_DATA, | ||
value: global.dependencyTreeData, | ||
}); | ||
} | ||
} | ||
); | ||
export const allCommands = [command_createView, command_reOpenView]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
import { namedTypes } from 'ast-types/gen/namedTypes'; | ||
import { namedTypes } from "ast-types/gen/namedTypes"; | ||
export interface FileInformation { | ||
introduction?: string; | ||
description?: string; | ||
introduction?: string; | ||
description?: string; | ||
} | ||
export interface Param { | ||
name: string; | ||
type?: string; | ||
name: string; | ||
type?: string; | ||
} | ||
export interface FunctionInformation { | ||
comment?: string; | ||
export: boolean; | ||
code: string; | ||
loc: namedTypes.SourceLocation | null | undefined; | ||
params: Param[] | []; | ||
arrowFunction: boolean; | ||
kind: 'const' | 'let' | 'function' | 'var'; | ||
name: string; | ||
comment?: string; | ||
export: boolean; | ||
code: string; | ||
loc: namedTypes.SourceLocation | null | undefined; | ||
params: Param[] | []; | ||
arrowFunction: boolean; | ||
kind: "const" | "let" | "function" | "var"; | ||
name: string; | ||
} | ||
export interface DependencyTreeData { | ||
name: string; | ||
name: string; | ||
fileDescription: FileInformation; | ||
circularStructure?:true; | ||
type: string; | ||
lines: number | undefined; | ||
analysed: boolean; | ||
functions: FunctionInformation[] | []; | ||
extension: string; | ||
absolutePath: string; | ||
relativePath: string; | ||
ancestors: string[]; | ||
children: Array<DependencyTreeData>; | ||
circularStructure?: true; | ||
type: string; | ||
lines: number | undefined; | ||
analysed: boolean; | ||
functions: FunctionInformation[] | []; | ||
extension: string; | ||
absolutePath: string; | ||
relativePath: string; | ||
ancestors: string[]; | ||
children: Array<DependencyTreeData>; | ||
} |
Oops, something went wrong.