@theia/search-in-workspace 1.34.3 → 1.34.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/LICENSE +641 -641
  2. package/README.md +40 -40
  3. package/lib/browser/components/search-in-workspace-input.d.ts +39 -39
  4. package/lib/browser/components/search-in-workspace-input.js +120 -120
  5. package/lib/browser/search-in-workspace-context-key-service.d.ts +23 -23
  6. package/lib/browser/search-in-workspace-context-key-service.js +90 -90
  7. package/lib/browser/search-in-workspace-factory.d.ts +10 -10
  8. package/lib/browser/search-in-workspace-factory.js +68 -68
  9. package/lib/browser/search-in-workspace-frontend-contribution.d.ts +53 -53
  10. package/lib/browser/search-in-workspace-frontend-contribution.js +410 -410
  11. package/lib/browser/search-in-workspace-frontend-module.d.ts +6 -6
  12. package/lib/browser/search-in-workspace-frontend-module.js +70 -70
  13. package/lib/browser/search-in-workspace-label-provider.d.ts +9 -9
  14. package/lib/browser/search-in-workspace-label-provider.js +57 -57
  15. package/lib/browser/search-in-workspace-preferences.d.ts +17 -17
  16. package/lib/browser/search-in-workspace-preferences.js +82 -82
  17. package/lib/browser/search-in-workspace-result-tree-widget.d.ts +253 -253
  18. package/lib/browser/search-in-workspace-result-tree-widget.js +1072 -1072
  19. package/lib/browser/search-in-workspace-service.d.ts +35 -35
  20. package/lib/browser/search-in-workspace-service.js +158 -158
  21. package/lib/browser/search-in-workspace-widget.d.ts +121 -121
  22. package/lib/browser/search-in-workspace-widget.js +602 -602
  23. package/lib/browser/search-layout-migrations.d.ts +5 -5
  24. package/lib/browser/search-layout-migrations.js +64 -64
  25. package/lib/common/search-in-workspace-interface.d.ts +112 -112
  26. package/lib/common/search-in-workspace-interface.js +35 -35
  27. package/lib/node/ripgrep-search-in-workspace-server.d.ts +94 -94
  28. package/lib/node/ripgrep-search-in-workspace-server.js +423 -423
  29. package/lib/node/ripgrep-search-in-workspace-server.slow-spec.d.ts +1 -1
  30. package/lib/node/ripgrep-search-in-workspace-server.slow-spec.js +899 -899
  31. package/lib/node/search-in-workspace-backend-module.d.ts +3 -3
  32. package/lib/node/search-in-workspace-backend-module.js +32 -32
  33. package/package.json +9 -9
  34. package/src/browser/components/search-in-workspace-input.tsx +139 -139
  35. package/src/browser/search-in-workspace-context-key-service.ts +93 -93
  36. package/src/browser/search-in-workspace-factory.ts +59 -59
  37. package/src/browser/search-in-workspace-frontend-contribution.ts +402 -402
  38. package/src/browser/search-in-workspace-frontend-module.ts +82 -82
  39. package/src/browser/search-in-workspace-label-provider.ts +48 -48
  40. package/src/browser/search-in-workspace-preferences.ts +91 -91
  41. package/src/browser/search-in-workspace-result-tree-widget.tsx +1225 -1225
  42. package/src/browser/search-in-workspace-service.ts +152 -152
  43. package/src/browser/search-in-workspace-widget.tsx +711 -711
  44. package/src/browser/search-layout-migrations.ts +53 -53
  45. package/src/browser/styles/index.css +367 -367
  46. package/src/browser/styles/search.svg +6 -6
  47. package/src/common/search-in-workspace-interface.ts +149 -149
  48. package/src/node/ripgrep-search-in-workspace-server.slow-spec.ts +1073 -1073
  49. package/src/node/ripgrep-search-in-workspace-server.ts +482 -482
  50. package/src/node/search-in-workspace-backend-module.ts +33 -33
package/README.md CHANGED
@@ -1,40 +1,40 @@
1
- <div align='center'>
2
-
3
- <br />
4
-
5
- <img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
6
-
7
- <h2>ECLIPSE THEIA - SEARCH-IN-WORKSPACE EXTENSION</h2>
8
-
9
- <hr />
10
-
11
- </div>
12
-
13
- ## Description
14
-
15
- The `@theia/search-in-workspace` extension provides the ability to perform searches over all files in a given workspace using different search techniques.
16
-
17
- ## Search Widget
18
-
19
- The `@theia/search-in-workspace` extension contributes the `Search` widget which is capable of performing different types of searches include the possibility to:
20
- - Perform standard searches
21
- - Perform searches using regular expressions
22
- - Perform searches within an `include` list (search for specific types of files (ex: `*.ts`))
23
- - Perform searches excluding files or directories (using `exclude`)
24
- - Perform searches ignoring hidden or excluded files/folders
25
- - Perform search and replace (to quickly update multiple occurrences of a search term)
26
-
27
- ## Additional Information
28
-
29
- - [API documentation for `@theia/search-in-workspace`](https://eclipse-theia.github.io/theia/docs/next/modules/search_in_workspace.html)
30
- - [Theia - GitHub](https://github.com/eclipse-theia/theia)
31
- - [Theia - Website](https://theia-ide.org/)
32
-
33
- ## License
34
-
35
- - [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
36
- - [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
37
-
38
- ## Trademark
39
- "Theia" is a trademark of the Eclipse Foundation
40
- https://www.eclipse.org/theia
1
+ <div align='center'>
2
+
3
+ <br />
4
+
5
+ <img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
6
+
7
+ <h2>ECLIPSE THEIA - SEARCH-IN-WORKSPACE EXTENSION</h2>
8
+
9
+ <hr />
10
+
11
+ </div>
12
+
13
+ ## Description
14
+
15
+ The `@theia/search-in-workspace` extension provides the ability to perform searches over all files in a given workspace using different search techniques.
16
+
17
+ ## Search Widget
18
+
19
+ The `@theia/search-in-workspace` extension contributes the `Search` widget which is capable of performing different types of searches include the possibility to:
20
+ - Perform standard searches
21
+ - Perform searches using regular expressions
22
+ - Perform searches within an `include` list (search for specific types of files (ex: `*.ts`))
23
+ - Perform searches excluding files or directories (using `exclude`)
24
+ - Perform searches ignoring hidden or excluded files/folders
25
+ - Perform search and replace (to quickly update multiple occurrences of a search term)
26
+
27
+ ## Additional Information
28
+
29
+ - [API documentation for `@theia/search-in-workspace`](https://eclipse-theia.github.io/theia/docs/next/modules/search_in_workspace.html)
30
+ - [Theia - GitHub](https://github.com/eclipse-theia/theia)
31
+ - [Theia - Website](https://theia-ide.org/)
32
+
33
+ ## License
34
+
35
+ - [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
36
+ - [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
37
+
38
+ ## Trademark
39
+ "Theia" is a trademark of the Eclipse Foundation
40
+ https://www.eclipse.org/theia
@@ -1,40 +1,40 @@
1
- /// <reference types="lodash" />
2
- /// <reference types="react" />
3
- import * as React from '@theia/core/shared/react';
4
- interface HistoryState {
5
- history: string[];
6
- index: number;
7
- }
8
- declare type InputAttributes = React.InputHTMLAttributes<HTMLInputElement>;
9
- export declare class SearchInWorkspaceInput extends React.Component<InputAttributes, HistoryState> {
10
- static LIMIT: number;
11
- private input;
12
- constructor(props: InputAttributes);
13
- updateState(index: number, history?: string[]): void;
14
- get value(): string;
15
- set value(value: string);
16
- /**
17
- * Handle history navigation without overriding the parent's onKeyDown handler, if any.
18
- */
19
- protected readonly onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void;
20
- /**
21
- * Switch the input's text to the previous value, if any.
22
- */
23
- previousValue(): void;
24
- /**
25
- * Switch the input's text to the next value, if any.
26
- */
27
- nextValue(): void;
28
- /**
29
- * Handle history collection without overriding the parent's onChange handler, if any.
30
- */
31
- protected readonly onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
32
- /**
33
- * Add a nonempty current value to the history, if not already present. (Debounced, 1 second delay.)
34
- */
35
- readonly addToHistory: import("lodash").DebouncedFunc<() => void>;
36
- private doAddToHistory;
37
- render(): React.ReactNode;
38
- }
39
- export {};
1
+ /// <reference types="lodash" />
2
+ /// <reference types="react" />
3
+ import * as React from '@theia/core/shared/react';
4
+ interface HistoryState {
5
+ history: string[];
6
+ index: number;
7
+ }
8
+ declare type InputAttributes = React.InputHTMLAttributes<HTMLInputElement>;
9
+ export declare class SearchInWorkspaceInput extends React.Component<InputAttributes, HistoryState> {
10
+ static LIMIT: number;
11
+ private input;
12
+ constructor(props: InputAttributes);
13
+ updateState(index: number, history?: string[]): void;
14
+ get value(): string;
15
+ set value(value: string);
16
+ /**
17
+ * Handle history navigation without overriding the parent's onKeyDown handler, if any.
18
+ */
19
+ protected readonly onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void;
20
+ /**
21
+ * Switch the input's text to the previous value, if any.
22
+ */
23
+ previousValue(): void;
24
+ /**
25
+ * Switch the input's text to the next value, if any.
26
+ */
27
+ nextValue(): void;
28
+ /**
29
+ * Handle history collection without overriding the parent's onChange handler, if any.
30
+ */
31
+ protected readonly onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
32
+ /**
33
+ * Add a nonempty current value to the history, if not already present. (Debounced, 1 second delay.)
34
+ */
35
+ readonly addToHistory: import("lodash").DebouncedFunc<() => void>;
36
+ private doAddToHistory;
37
+ render(): React.ReactNode;
38
+ }
39
+ export {};
40
40
  //# sourceMappingURL=search-in-workspace-input.d.ts.map
@@ -1,121 +1,121 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2021 Ericsson and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.SearchInWorkspaceInput = void 0;
19
- const React = require("@theia/core/shared/react");
20
- const browser_1 = require("@theia/core/lib/browser");
21
- const debounce = require("@theia/core/shared/lodash.debounce");
22
- ;
23
- class SearchInWorkspaceInput extends React.Component {
24
- constructor(props) {
25
- super(props);
26
- this.input = React.createRef();
27
- /**
28
- * Handle history navigation without overriding the parent's onKeyDown handler, if any.
29
- */
30
- this.onKeyDown = (e) => {
31
- var _a, _b, _c, _d;
32
- if (browser_1.Key.ARROW_UP.keyCode === ((_a = browser_1.KeyCode.createKeyCode(e.nativeEvent).key) === null || _a === void 0 ? void 0 : _a.keyCode)) {
33
- e.preventDefault();
34
- this.previousValue();
35
- }
36
- else if (browser_1.Key.ARROW_DOWN.keyCode === ((_b = browser_1.KeyCode.createKeyCode(e.nativeEvent).key) === null || _b === void 0 ? void 0 : _b.keyCode)) {
37
- e.preventDefault();
38
- this.nextValue();
39
- }
40
- (_d = (_c = this.props).onKeyDown) === null || _d === void 0 ? void 0 : _d.call(_c, e);
41
- };
42
- /**
43
- * Handle history collection without overriding the parent's onChange handler, if any.
44
- */
45
- this.onChange = (e) => {
46
- var _a, _b;
47
- this.addToHistory();
48
- (_b = (_a = this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, e);
49
- };
50
- /**
51
- * Add a nonempty current value to the history, if not already present. (Debounced, 1 second delay.)
52
- */
53
- this.addToHistory = debounce(this.doAddToHistory, 1000);
54
- this.state = {
55
- history: [],
56
- index: 0,
57
- };
58
- }
59
- updateState(index, history) {
60
- this.value = history ? history[index] : this.state.history[index];
61
- this.setState(prevState => {
62
- const newState = Object.assign(Object.assign({}, prevState), { index });
63
- if (history) {
64
- newState.history = history;
65
- }
66
- return newState;
67
- });
68
- }
69
- get value() {
70
- var _a, _b;
71
- return (_b = (_a = this.input.current) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '';
72
- }
73
- set value(value) {
74
- if (this.input.current) {
75
- this.input.current.value = value;
76
- }
77
- }
78
- /**
79
- * Switch the input's text to the previous value, if any.
80
- */
81
- previousValue() {
82
- const { history, index } = this.state;
83
- if (!this.value) {
84
- this.value = history[index];
85
- }
86
- else if (index > 0 && index < history.length) {
87
- this.updateState(index - 1);
88
- }
89
- }
90
- /**
91
- * Switch the input's text to the next value, if any.
92
- */
93
- nextValue() {
94
- const { history, index } = this.state;
95
- if (index === history.length - 1) {
96
- this.value = '';
97
- }
98
- else if (!this.value) {
99
- this.value = history[index];
100
- }
101
- else if (index >= 0 && index < history.length - 1) {
102
- this.updateState(index + 1);
103
- }
104
- }
105
- doAddToHistory() {
106
- if (!this.value) {
107
- return;
108
- }
109
- const history = this.state.history
110
- .filter(term => term !== this.value)
111
- .concat(this.value)
112
- .slice(-SearchInWorkspaceInput.LIMIT);
113
- this.updateState(history.length - 1, history);
114
- }
115
- render() {
116
- return (React.createElement("input", Object.assign({}, this.props, { onKeyDown: this.onKeyDown, onChange: this.onChange, spellCheck: false, ref: this.input })));
117
- }
118
- }
119
- exports.SearchInWorkspaceInput = SearchInWorkspaceInput;
120
- SearchInWorkspaceInput.LIMIT = 100;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2021 Ericsson and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.SearchInWorkspaceInput = void 0;
19
+ const React = require("@theia/core/shared/react");
20
+ const browser_1 = require("@theia/core/lib/browser");
21
+ const debounce = require("@theia/core/shared/lodash.debounce");
22
+ ;
23
+ class SearchInWorkspaceInput extends React.Component {
24
+ constructor(props) {
25
+ super(props);
26
+ this.input = React.createRef();
27
+ /**
28
+ * Handle history navigation without overriding the parent's onKeyDown handler, if any.
29
+ */
30
+ this.onKeyDown = (e) => {
31
+ var _a, _b, _c, _d;
32
+ if (browser_1.Key.ARROW_UP.keyCode === ((_a = browser_1.KeyCode.createKeyCode(e.nativeEvent).key) === null || _a === void 0 ? void 0 : _a.keyCode)) {
33
+ e.preventDefault();
34
+ this.previousValue();
35
+ }
36
+ else if (browser_1.Key.ARROW_DOWN.keyCode === ((_b = browser_1.KeyCode.createKeyCode(e.nativeEvent).key) === null || _b === void 0 ? void 0 : _b.keyCode)) {
37
+ e.preventDefault();
38
+ this.nextValue();
39
+ }
40
+ (_d = (_c = this.props).onKeyDown) === null || _d === void 0 ? void 0 : _d.call(_c, e);
41
+ };
42
+ /**
43
+ * Handle history collection without overriding the parent's onChange handler, if any.
44
+ */
45
+ this.onChange = (e) => {
46
+ var _a, _b;
47
+ this.addToHistory();
48
+ (_b = (_a = this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, e);
49
+ };
50
+ /**
51
+ * Add a nonempty current value to the history, if not already present. (Debounced, 1 second delay.)
52
+ */
53
+ this.addToHistory = debounce(this.doAddToHistory, 1000);
54
+ this.state = {
55
+ history: [],
56
+ index: 0,
57
+ };
58
+ }
59
+ updateState(index, history) {
60
+ this.value = history ? history[index] : this.state.history[index];
61
+ this.setState(prevState => {
62
+ const newState = Object.assign(Object.assign({}, prevState), { index });
63
+ if (history) {
64
+ newState.history = history;
65
+ }
66
+ return newState;
67
+ });
68
+ }
69
+ get value() {
70
+ var _a, _b;
71
+ return (_b = (_a = this.input.current) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '';
72
+ }
73
+ set value(value) {
74
+ if (this.input.current) {
75
+ this.input.current.value = value;
76
+ }
77
+ }
78
+ /**
79
+ * Switch the input's text to the previous value, if any.
80
+ */
81
+ previousValue() {
82
+ const { history, index } = this.state;
83
+ if (!this.value) {
84
+ this.value = history[index];
85
+ }
86
+ else if (index > 0 && index < history.length) {
87
+ this.updateState(index - 1);
88
+ }
89
+ }
90
+ /**
91
+ * Switch the input's text to the next value, if any.
92
+ */
93
+ nextValue() {
94
+ const { history, index } = this.state;
95
+ if (index === history.length - 1) {
96
+ this.value = '';
97
+ }
98
+ else if (!this.value) {
99
+ this.value = history[index];
100
+ }
101
+ else if (index >= 0 && index < history.length - 1) {
102
+ this.updateState(index + 1);
103
+ }
104
+ }
105
+ doAddToHistory() {
106
+ if (!this.value) {
107
+ return;
108
+ }
109
+ const history = this.state.history
110
+ .filter(term => term !== this.value)
111
+ .concat(this.value)
112
+ .slice(-SearchInWorkspaceInput.LIMIT);
113
+ this.updateState(history.length - 1, history);
114
+ }
115
+ render() {
116
+ return (React.createElement("input", Object.assign({}, this.props, { onKeyDown: this.onKeyDown, onChange: this.onChange, spellCheck: false, ref: this.input })));
117
+ }
118
+ }
119
+ exports.SearchInWorkspaceInput = SearchInWorkspaceInput;
120
+ SearchInWorkspaceInput.LIMIT = 100;
121
121
  //# sourceMappingURL=search-in-workspace-input.js.map
@@ -1,24 +1,24 @@
1
- import { ContextKeyService, ContextKey } from '@theia/core/lib/browser/context-key-service';
2
- export declare class SearchInWorkspaceContextKeyService {
3
- protected readonly contextKeyService: ContextKeyService;
4
- protected _searchViewletVisible: ContextKey<boolean>;
5
- get searchViewletVisible(): ContextKey<boolean>;
6
- protected _searchViewletFocus: ContextKey<boolean>;
7
- get searchViewletFocus(): ContextKey<boolean>;
8
- protected searchInputBoxFocus: ContextKey<boolean>;
9
- setSearchInputBoxFocus(searchInputBoxFocus: boolean): void;
10
- protected replaceInputBoxFocus: ContextKey<boolean>;
11
- setReplaceInputBoxFocus(replaceInputBoxFocus: boolean): void;
12
- protected patternIncludesInputBoxFocus: ContextKey<boolean>;
13
- setPatternIncludesInputBoxFocus(patternIncludesInputBoxFocus: boolean): void;
14
- protected patternExcludesInputBoxFocus: ContextKey<boolean>;
15
- setPatternExcludesInputBoxFocus(patternExcludesInputBoxFocus: boolean): void;
16
- protected inputBoxFocus: ContextKey<boolean>;
17
- protected updateInputBoxFocus(): void;
18
- protected _replaceActive: ContextKey<boolean>;
19
- get replaceActive(): ContextKey<boolean>;
20
- protected _hasSearchResult: ContextKey<boolean>;
21
- get hasSearchResult(): ContextKey<boolean>;
22
- protected init(): void;
23
- }
1
+ import { ContextKeyService, ContextKey } from '@theia/core/lib/browser/context-key-service';
2
+ export declare class SearchInWorkspaceContextKeyService {
3
+ protected readonly contextKeyService: ContextKeyService;
4
+ protected _searchViewletVisible: ContextKey<boolean>;
5
+ get searchViewletVisible(): ContextKey<boolean>;
6
+ protected _searchViewletFocus: ContextKey<boolean>;
7
+ get searchViewletFocus(): ContextKey<boolean>;
8
+ protected searchInputBoxFocus: ContextKey<boolean>;
9
+ setSearchInputBoxFocus(searchInputBoxFocus: boolean): void;
10
+ protected replaceInputBoxFocus: ContextKey<boolean>;
11
+ setReplaceInputBoxFocus(replaceInputBoxFocus: boolean): void;
12
+ protected patternIncludesInputBoxFocus: ContextKey<boolean>;
13
+ setPatternIncludesInputBoxFocus(patternIncludesInputBoxFocus: boolean): void;
14
+ protected patternExcludesInputBoxFocus: ContextKey<boolean>;
15
+ setPatternExcludesInputBoxFocus(patternExcludesInputBoxFocus: boolean): void;
16
+ protected inputBoxFocus: ContextKey<boolean>;
17
+ protected updateInputBoxFocus(): void;
18
+ protected _replaceActive: ContextKey<boolean>;
19
+ get replaceActive(): ContextKey<boolean>;
20
+ protected _hasSearchResult: ContextKey<boolean>;
21
+ get hasSearchResult(): ContextKey<boolean>;
22
+ protected init(): void;
23
+ }
24
24
  //# sourceMappingURL=search-in-workspace-context-key-service.d.ts.map
@@ -1,91 +1,91 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2019 TypeFox and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
- return c > 3 && r && Object.defineProperty(target, key, r), r;
22
- };
23
- var __metadata = (this && this.__metadata) || function (k, v) {
24
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
- };
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.SearchInWorkspaceContextKeyService = void 0;
28
- const inversify_1 = require("@theia/core/shared/inversify");
29
- const context_key_service_1 = require("@theia/core/lib/browser/context-key-service");
30
- let SearchInWorkspaceContextKeyService = class SearchInWorkspaceContextKeyService {
31
- get searchViewletVisible() {
32
- return this._searchViewletVisible;
33
- }
34
- get searchViewletFocus() {
35
- return this._searchViewletFocus;
36
- }
37
- setSearchInputBoxFocus(searchInputBoxFocus) {
38
- this.searchInputBoxFocus.set(searchInputBoxFocus);
39
- this.updateInputBoxFocus();
40
- }
41
- setReplaceInputBoxFocus(replaceInputBoxFocus) {
42
- this.replaceInputBoxFocus.set(replaceInputBoxFocus);
43
- this.updateInputBoxFocus();
44
- }
45
- setPatternIncludesInputBoxFocus(patternIncludesInputBoxFocus) {
46
- this.patternIncludesInputBoxFocus.set(patternIncludesInputBoxFocus);
47
- this.updateInputBoxFocus();
48
- }
49
- setPatternExcludesInputBoxFocus(patternExcludesInputBoxFocus) {
50
- this.patternExcludesInputBoxFocus.set(patternExcludesInputBoxFocus);
51
- this.updateInputBoxFocus();
52
- }
53
- updateInputBoxFocus() {
54
- this.inputBoxFocus.set(this.searchInputBoxFocus.get() ||
55
- this.replaceInputBoxFocus.get() ||
56
- this.patternIncludesInputBoxFocus.get() ||
57
- this.patternExcludesInputBoxFocus.get());
58
- }
59
- get replaceActive() {
60
- return this._replaceActive;
61
- }
62
- get hasSearchResult() {
63
- return this._hasSearchResult;
64
- }
65
- init() {
66
- this._searchViewletVisible = this.contextKeyService.createKey('searchViewletVisible', false);
67
- this._searchViewletFocus = this.contextKeyService.createKey('searchViewletFocus', false);
68
- this.inputBoxFocus = this.contextKeyService.createKey('inputBoxFocus', false);
69
- this.searchInputBoxFocus = this.contextKeyService.createKey('searchInputBoxFocus', false);
70
- this.replaceInputBoxFocus = this.contextKeyService.createKey('replaceInputBoxFocus', false);
71
- this.patternIncludesInputBoxFocus = this.contextKeyService.createKey('patternIncludesInputBoxFocus', false);
72
- this.patternExcludesInputBoxFocus = this.contextKeyService.createKey('patternExcludesInputBoxFocus', false);
73
- this._replaceActive = this.contextKeyService.createKey('replaceActive', false);
74
- this._hasSearchResult = this.contextKeyService.createKey('hasSearchResult', false);
75
- }
76
- };
77
- __decorate([
78
- (0, inversify_1.inject)(context_key_service_1.ContextKeyService),
79
- __metadata("design:type", Object)
80
- ], SearchInWorkspaceContextKeyService.prototype, "contextKeyService", void 0);
81
- __decorate([
82
- (0, inversify_1.postConstruct)(),
83
- __metadata("design:type", Function),
84
- __metadata("design:paramtypes", []),
85
- __metadata("design:returntype", void 0)
86
- ], SearchInWorkspaceContextKeyService.prototype, "init", null);
87
- SearchInWorkspaceContextKeyService = __decorate([
88
- (0, inversify_1.injectable)()
89
- ], SearchInWorkspaceContextKeyService);
90
- exports.SearchInWorkspaceContextKeyService = SearchInWorkspaceContextKeyService;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2019 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.SearchInWorkspaceContextKeyService = void 0;
28
+ const inversify_1 = require("@theia/core/shared/inversify");
29
+ const context_key_service_1 = require("@theia/core/lib/browser/context-key-service");
30
+ let SearchInWorkspaceContextKeyService = class SearchInWorkspaceContextKeyService {
31
+ get searchViewletVisible() {
32
+ return this._searchViewletVisible;
33
+ }
34
+ get searchViewletFocus() {
35
+ return this._searchViewletFocus;
36
+ }
37
+ setSearchInputBoxFocus(searchInputBoxFocus) {
38
+ this.searchInputBoxFocus.set(searchInputBoxFocus);
39
+ this.updateInputBoxFocus();
40
+ }
41
+ setReplaceInputBoxFocus(replaceInputBoxFocus) {
42
+ this.replaceInputBoxFocus.set(replaceInputBoxFocus);
43
+ this.updateInputBoxFocus();
44
+ }
45
+ setPatternIncludesInputBoxFocus(patternIncludesInputBoxFocus) {
46
+ this.patternIncludesInputBoxFocus.set(patternIncludesInputBoxFocus);
47
+ this.updateInputBoxFocus();
48
+ }
49
+ setPatternExcludesInputBoxFocus(patternExcludesInputBoxFocus) {
50
+ this.patternExcludesInputBoxFocus.set(patternExcludesInputBoxFocus);
51
+ this.updateInputBoxFocus();
52
+ }
53
+ updateInputBoxFocus() {
54
+ this.inputBoxFocus.set(this.searchInputBoxFocus.get() ||
55
+ this.replaceInputBoxFocus.get() ||
56
+ this.patternIncludesInputBoxFocus.get() ||
57
+ this.patternExcludesInputBoxFocus.get());
58
+ }
59
+ get replaceActive() {
60
+ return this._replaceActive;
61
+ }
62
+ get hasSearchResult() {
63
+ return this._hasSearchResult;
64
+ }
65
+ init() {
66
+ this._searchViewletVisible = this.contextKeyService.createKey('searchViewletVisible', false);
67
+ this._searchViewletFocus = this.contextKeyService.createKey('searchViewletFocus', false);
68
+ this.inputBoxFocus = this.contextKeyService.createKey('inputBoxFocus', false);
69
+ this.searchInputBoxFocus = this.contextKeyService.createKey('searchInputBoxFocus', false);
70
+ this.replaceInputBoxFocus = this.contextKeyService.createKey('replaceInputBoxFocus', false);
71
+ this.patternIncludesInputBoxFocus = this.contextKeyService.createKey('patternIncludesInputBoxFocus', false);
72
+ this.patternExcludesInputBoxFocus = this.contextKeyService.createKey('patternExcludesInputBoxFocus', false);
73
+ this._replaceActive = this.contextKeyService.createKey('replaceActive', false);
74
+ this._hasSearchResult = this.contextKeyService.createKey('hasSearchResult', false);
75
+ }
76
+ };
77
+ __decorate([
78
+ (0, inversify_1.inject)(context_key_service_1.ContextKeyService),
79
+ __metadata("design:type", Object)
80
+ ], SearchInWorkspaceContextKeyService.prototype, "contextKeyService", void 0);
81
+ __decorate([
82
+ (0, inversify_1.postConstruct)(),
83
+ __metadata("design:type", Function),
84
+ __metadata("design:paramtypes", []),
85
+ __metadata("design:returntype", void 0)
86
+ ], SearchInWorkspaceContextKeyService.prototype, "init", null);
87
+ SearchInWorkspaceContextKeyService = __decorate([
88
+ (0, inversify_1.injectable)()
89
+ ], SearchInWorkspaceContextKeyService);
90
+ exports.SearchInWorkspaceContextKeyService = SearchInWorkspaceContextKeyService;
91
91
  //# sourceMappingURL=search-in-workspace-context-key-service.js.map