Skip to content
This repository has been archived by the owner on Oct 10, 2018. It is now read-only.

feat: multi root workspace support #325

Merged
merged 41 commits into from
Oct 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
793e1e8
adding mapper
Oct 10, 2017
4e63e1e
move helpers, move mapper
Oct 10, 2017
753615c
1st ver of mapper
Oct 10, 2017
7bce399
adding declaration index
Oct 11, 2017
bb4a4e6
moved Declaration Index
Oct 11, 2017
5fc5780
change code actions
Oct 12, 2017
b07c730
change code completion
Oct 12, 2017
2293153
moved mapper
Oct 12, 2017
f305b49
style
Oct 12, 2017
2317f7f
change settings scope
Oct 12, 2017
8a5e117
change scope of settings
Oct 17, 2017
db174f7
change the config interface
Oct 17, 2017
b211331
adding new configs
Oct 17, 2017
fb6572f
add new config structure
Oct 17, 2017
b746d9c
adding factory and ctor for configs
Oct 17, 2017
5e64378
add config factory
Oct 17, 2017
97c769a
remove old config
Oct 17, 2017
1b25943
change config in code completion
Oct 18, 2017
87495c0
change symbol structure extension
Oct 18, 2017
09a1545
adding event for start / finish / err index
Oct 18, 2017
c3a437c
add new config to other ext
Oct 18, 2017
e91bb5f
update all config related files (without tests)
Oct 18, 2017
57fa8c1
adding multi-root file
Oct 18, 2017
f38ca6c
launch config
Oct 18, 2017
e4e2aa1
add default settings for testing
Oct 18, 2017
cd35529
adding workspace test files
Oct 18, 2017
75aadd0
change base config
Oct 18, 2017
847fff4
settings / comments
Oct 18, 2017
1dbe229
move test files
Oct 18, 2017
716465f
change vars
Oct 23, 2017
6be37c2
add config for multi root launch
Oct 23, 2017
669f920
fixing tests (basic)
Oct 24, 2017
404f95c
try fix test
Oct 25, 2017
5ba9a29
fixing first tests
Oct 25, 2017
1258453
fixing tests
Oct 25, 2017
0fb64b4
fix tests
Oct 25, 2017
e700fc9
adding test file for multi root
Oct 25, 2017
829eb9f
add file
Oct 25, 2017
1788d76
docs
Oct 26, 2017
df86b51
Merge branch 'develop' into feat/multi-root-support
buehler Oct 26, 2017
b2f230f
ups.
Oct 26, 2017
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
10 changes: 3 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ node_js:
notifications:
email: false

env:
global:
- CODE_TESTS_WORKSPACE=$TRAVIS_BUILD_DIR/test/_workspace

os:
- linux

Expand All @@ -32,8 +28,8 @@ addons:
before_install:
- if [ $TRAVIS_OS_NAME == "linux" ]; then
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0;
sh -e /etc/init.d/xvfb start;
sleep 3;
sh -e /etc/init.d/xvfb start;
sleep 3;
fi
- rvm get stable
- rvm install 2.4
Expand All @@ -42,7 +38,7 @@ before_install:

install:
- yarn install

before_script:
- greenkeeper-lockfile-update
- yarn run build
Expand Down
35 changes: 33 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,45 @@
]
},
{
"name": "Launch Tests",
"name": "Launch Extension Multi-Root",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"${workspaceRoot}/test/multi-root.code-workspace",
"--extensionDevelopmentPath=${workspaceRoot}"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/out/src/**/*.js"
]
},
{
"name": "Launch Tests (single Workspace)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"${workspaceRoot}/test/_workspace",
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/out/test"
"--extensionTestsPath=${workspaceRoot}/out/test/single-workspace-tests/"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/out/test/single-workspace-tests/**/*.js"
]
},
{
"name": "Launch Tests (multi-root Workspace)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"${workspaceRoot}/test/multi-root.code-workspace",
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/out/test/multi-root-workspace-tests/"
],
"stopOnEntry": false,
"sourceMaps": true,
Expand Down
6 changes: 4 additions & 2 deletions config/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"target": "es6",
"outDir": "../out",
"lib": [
"es6"
"es6",
"es2017"
],
"rootDir": "..",
"emitDecoratorMetadata": true,
Expand All @@ -20,6 +21,7 @@
"../test/**/*"
],
"exclude": [
"../test/_workspace"
"../test/_workspace",
"../test/_workspace_2"
]
}
61 changes: 39 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"version": "0.0.0-development",
"publisher": "rbbit",
"engines": {
"vscode": "^1.13.0",
"vscode": "^1.17.0",
"node": ">=8.0.0",
"npm": ">=5.3.0"
},
Expand Down Expand Up @@ -80,13 +80,15 @@
"predevelop": "del-cli ./out",
"develop": "tsc",
"postinstall": "test -f ./node_modules/vscode/bin/install && node ./node_modules/vscode/bin/install || echo 'vscode/bin/install not found'",
"pretest": "del-cli ./out && tsc -p ./config/tsconfig.test.json && yarn run lint",
"test": "node ./node_modules/vscode/bin/test",
"lint": "tslint -c tslint.json --project ./config/tsconfig.build.json",
"pretest": "del-cli ./out && tsc -p ./config/tsconfig.test.json && yarn lint",
"test": "yarn test:single-workspace",
"test:single-workspace": "CODE_TESTS_WORKSPACE=$(pwd)/test/_workspace CODE_TESTS_PATH=$(pwd)/out/test/single-workspace-tests node ./node_modules/vscode/bin/test",
"test:multi-workspace": "CODE_TESTS_WORKSPACE=$(pwd)/test/multi-root.code-workspace CODE_TESTS_PATH=$(pwd)/out/test/multi-root-workspace-tests node ./node_modules/vscode/bin/test",
"build": "del-cli ./out && tsc -p ./config/tsconfig.build.json",
"package": "yarn run build && del-cli './*.vsix' && vsce package",
"package": "yarn build && del-cli './*.vsix' && vsce package",
"semantic-release-pre": "semantic-release pre",
"semantic-release": "yarn run semantic-release-pre && vsce package && vsce publish -p $VSCE_TOKEN && yarn install && semantic-release post"
"semantic-release": "yarn semantic-release-pre && vsce package && vsce publish -p $VSCE_TOKEN && yarn install && semantic-release post"
},
"devDependencies": {
"@types/chai": "^4.0.4",
Expand Down Expand Up @@ -199,33 +201,38 @@
"All"
],
"default": "Warnings",
"description": "Defines the log output level in the output window."
"description": "Defines the log output level in the output window.",
"scope": "window"
},
"typescriptHero.completionSortMode": {
"typescriptHero.codeCompletion.completionSortMode": {
"enum": [
"default",
"bottom"
],
"default": "default",
"description": "Import completion sort order"
"description": "Defines the sortmode of the code completion in intellisense (bottom means sorted to bottom).",
"scope": "resource"
},
"typescriptHero.resolver.insertSpaceBeforeAndAfterImportBraces": {
"type": "boolean",
"default": true,
"description": "Defines if there should be a space inside the curly braces of an import statement."
"description": "Defines if there should be a space inside the curly braces of an import statement.",
"scope": "resource"
},
"typescriptHero.resolver.insertSemicolons": {
"type": "boolean",
"default": true,
"description": "Defines if there should be a semicolon at the end of a statement."
"description": "Defines if there should be a semicolon at the end of a statement.",
"scope": "resource"
},
"typescriptHero.resolver.stringQuoteStyle": {
"enum": [
"'",
"\""
],
"default": "'",
"description": "Defines if single or double quotes should be used."
"description": "Defines if single or double quotes should be used.",
"scope": "resource"
},
"typescriptHero.resolver.ignorePatterns": {
"type": "array",
Expand All @@ -238,24 +245,28 @@
"out",
"dist"
],
"description": "Defines partial pathes that are ignored during indexing (e.g. 'node_modules' would exclude all modules)."
"description": "Defines partial pathes that are ignored during indexing (e.g. 'node_modules' would exclude all modules).",
"scope": "resource"
},
"typescriptHero.resolver.multiLineWrapThreshold": {
"type": "number",
"minimum": 1,
"multipleOf": 1,
"default": 125,
"description": "Defines the threshold when an import should be wrapped into a multiline import."
"description": "Defines the threshold when an import should be wrapped into a multiline import.",
"scope": "resource"
},
"typescriptHero.resolver.multiLineTrailingComma": {
"type": "boolean",
"default": true,
"description": "Defined if multi line imports contain the last trailing comma."
"description": "Defined if multi line imports contain the last trailing comma.",
"scope": "resource"
},
"typescriptHero.resolver.disableImportsSorting": {
"type": "boolean",
"default": false,
"description": "Defines if sorting is disable during organize imports."
"description": "Defines if sorting is disable during organize imports.",
"scope": "resource"
},
"typescriptHero.resolver.disableImportRemovalOnOrganize": {
"type": "boolean",
Expand All @@ -265,7 +276,8 @@
"typescriptHero.resolver.organizeOnSave": {
"type": "boolean",
"default": false,
"description": "Defines if the imports should be organized on save."
"description": "Defines if the imports should be organized on save.",
"scope": "resource"
},
"typescriptHero.resolver.ignoreImportsForOrganize": {
"type": "array",
Expand All @@ -276,7 +288,8 @@
"default": [
"react"
],
"description": "Defines imports (libraries, so the 'from' part), which are not removed during 'organize imports'."
"description": "Defines imports (libraries, so the 'from' part), which are not removed during 'organize imports'.",
"scope": "resource"
},
"typescriptHero.resolver.importGroups": {
"type": "array",
Expand Down Expand Up @@ -345,26 +358,30 @@
"Modules",
"Workspace"
],
"description": "Defines the groups of the imports ordering. Multiple groups possible, see readme for instructions."
"description": "Defines the groups of the imports ordering. Multiple groups possible, see readme for instructions.",
"scope": "resource"
},
"typescriptHero.resolver.resolverMode": {
"enum": [
"TypeScript",
"ES6",
"Both"
],
"default": "TypeScript",
"description": "Defines the mode of the symbol resolver (i.e. if JavaScript files should be indexed as well (experimental)."
"default": "Both",
"description": "Defines the mode of the symbol resolver. (Note that JavaScript mode only indexes workspace files)",
"scope": "resource"
},
"typescriptHero.resolver.promptForSpecifiers": {
"type": "boolean",
"default": true,
"description": "Defines if typescript hero should ask the user for default specifiers or duplicate specifier aliases."
"description": "Defines if typescript hero should ask the user for default specifiers or duplicate specifier aliases.",
"scope": "window"
},
"typescriptHero.codeOutline.enabled": {
"type": "boolean",
"default": true,
"description": "Defines if the code outline feature (and window) are enabled or not."
"description": "Defines if the code outline feature (and window) are enabled or not.",
"scope": "window"
}
}
}
Expand Down
28 changes: 28 additions & 0 deletions src/common/config/CodeCompletionConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Uri } from 'vscode';

/**
* Configuration interface for the code outline feature.
*
* @export
* @interface CodeCompletionConfig
*/
export interface CodeCompletionConfig {
/**
* The given resource URI (if any) for the actual configuration.
* Is needed to determine the actual config values for multi root environments.
*
* @readonly
* @type {Uri}
* @memberof CodeCompletionConfig
*/
resource?: Uri;

/**
* Defines the used completion sort mode (i.e. if the completions should be sorted to the bottom of the list).
*
* @readonly
* @type {('default' | 'bottom')}
* @memberof CodeCompletionConfig
*/
completionSortMode: 'default' | 'bottom';
}
16 changes: 14 additions & 2 deletions src/common/config/CodeOutlineConfig.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
import { Uri } from 'vscode';

/**
* Configuration interface for the code outline feature.
*
*
* @export
* @interface CodeOutlineConfig
*/
export interface CodeOutlineConfig {
/**
* The given resource URI (if any) for the actual configuration.
* Is needed to determine the actual config values for multi root environments.
*
* @readonly
* @type {Uri}
* @memberof CodeOutlineConfig
*/
resource?: Uri;

/**
* Defined if the code outline feature is enabled or not.
*
*
* @type {boolean}
* @memberof CodeOutlineConfig
*/
Expand Down
39 changes: 29 additions & 10 deletions src/common/config/ExtensionConfig.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,47 @@
import { Uri } from 'vscode';

import { CodeCompletionConfig } from './CodeCompletionConfig';
import { CodeOutlineConfig } from './CodeOutlineConfig';
import { ResolverConfig } from './ResolverConfig';

/**
* Configuration interface for TypeScript Hero
* Contains all exposed config endpoints.
*
*
* @export
* @interface ExtensionConfig
*/
export interface ExtensionConfig {
/**
* The given resource URI (if any) for the actual configuration.
* Is needed to determine the actual config values for multi root environments.
*
* @readonly
* @type {Uri}
* @memberof ExtensionConfig
*/
resource?: Uri;

/**
* The actual log level.
*
*
* @readonly
* @type {string}
* @memberof ExtensionConfig
*/
verbosity: string;

/**
* Returns a list of possible language IDs that are registered within this extension.
*
* @type {string[]}
* @memberof ExtensionConfig
*/
possibleLanguages: string[];

/**
* Configuration object for the resolver extension.
*
*
* @readonly
* @type {ResolverConfig}
* @memberof ExtensionConfig
Expand All @@ -29,21 +50,19 @@ export interface ExtensionConfig {

/**
* Configuration object for the code outline extension.
*
*
* @readonly
* @type {CodeOutlineConfig}
* @memberof ExtensionConfig
*/
codeOutline: CodeOutlineConfig;

/**
* Completion sorting mode:
* default: Use default VSCode sorting mode
* bottom: Push to bottom
*
* Configuration object for the code completion extension.
*
* @readonly
* @type {'default'|'bottom'}
* @type {CodeCompletionConfig}
* @memberof ExtensionConfig
*/
completionSortMode: 'default' | 'bottom';
codeCompletion: CodeCompletionConfig;
}
Loading