Skip to content

Commit ee5cc0d

Browse files
authored
Merge branch 'main' into merogge/glob-fix
2 parents 13991f6 + 261a75e commit ee5cc0d

File tree

14 files changed

+104
-51
lines changed

14 files changed

+104
-51
lines changed

extensions/markdown-language-features/media/markdown.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ html, body {
99
padding: 0 26px;
1010
line-height: var(--markdown-line-height, 22px);
1111
word-wrap: break-word;
12+
overscroll-behavior-x: none;
1213
}
1314

1415
body {

extensions/markdown-language-features/src/preview/documentRenderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export class MdDocumentRenderer {
103103
${this._getStyles(resourceProvider, sourceUri, config, imageInfo)}
104104
<base href="${resourceProvider.asWebviewUri(markdownDocument.uri)}">
105105
</head>
106-
<body class="vscode-body style="overscroll-behavior-x: none;" ${config.scrollBeyondLastLine ? 'scrollBeyondLastLine' : ''} ${config.wordWrap ? 'wordWrap' : ''} ${config.markEditorSelection ? 'showEditorSelection' : ''}">
106+
<body class="vscode-body ${config.scrollBeyondLastLine ? 'scrollBeyondLastLine' : ''} ${config.wordWrap ? 'wordWrap' : ''} ${config.markEditorSelection ? 'showEditorSelection' : ''}">
107107
${body.html}
108108
${this._getScripts(resourceProvider, nonce)}
109109
</body>

extensions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "MIT",
55
"description": "Dependencies shared by all extensions",
66
"dependencies": {
7-
"typescript": "5.1.3"
7+
"typescript": "5.1.6"
88
},
99
"scripts": {
1010
"postinstall": "node ./postinstall.mjs"

extensions/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,10 @@ to-regex-range@^5.0.1:
228228
dependencies:
229229
is-number "^7.0.0"
230230

231-
232-
version "5.1.3"
233-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.3.tgz#8d84219244a6b40b6fb2b33cc1c062f715b9e826"
234-
integrity sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==
231+
232+
version "5.1.6"
233+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274"
234+
integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==
235235

236236
vscode-grammar-updater@^1.1.0:
237237
version "1.1.0"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@
210210
"ts-loader": "^9.4.2",
211211
"ts-node": "^10.9.1",
212212
"tsec": "0.2.7",
213-
"typescript": "^5.2.0-dev.20230621",
213+
"typescript": "^5.2.0-dev.20230710",
214214
"typescript-formatter": "7.1.0",
215215
"underscore": "^1.12.1",
216216
"util": "^0.12.4",

src/vs/base/browser/ui/inputbox/inputBox.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,19 @@ export class HistoryInputBox extends InputBox implements IHistoryNavigationWidge
685685
}
686686
}
687687

688+
public prependHistory(restoredHistory: string[]): void {
689+
const newHistory = this.getHistory();
690+
this.clearHistory();
691+
692+
restoredHistory.forEach((item) => {
693+
this.history.add(item);
694+
});
695+
696+
newHistory.forEach(item => {
697+
this.history.add(item);
698+
});
699+
}
700+
688701
public getHistory(): string[] {
689702
return this.history.getHistory();
690703
}

src/vs/workbench/contrib/search/browser/patternInputWidget.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ export class PatternInputWidget extends Widget {
116116
this.inputBox.clearHistory();
117117
}
118118

119+
prependHistory(history: string[]): void {
120+
this.inputBox.prependHistory(history);
121+
}
122+
119123
clear(): void {
120124
this.setValue('');
121125
}

src/vs/workbench/contrib/search/browser/searchView.ts

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ import { SearchWidget } from 'vs/workbench/contrib/search/browser/searchWidget';
7070
import * as Constants from 'vs/workbench/contrib/search/common/constants';
7171
import { IReplaceService } from 'vs/workbench/contrib/search/browser/replace';
7272
import { getOutOfWorkspaceEditorResources, SearchStateKey, SearchUIState } from 'vs/workbench/contrib/search/common/search';
73-
import { ISearchHistoryService, ISearchHistoryValues } from 'vs/workbench/contrib/search/common/searchHistoryService';
73+
import { ISearchHistoryService, ISearchHistoryValues, SearchHistoryService } from 'vs/workbench/contrib/search/common/searchHistoryService';
7474
import { FileMatch, FileMatchOrMatch, FolderMatch, FolderMatchWithResource, IChangeEvent, ISearchWorkbenchService, Match, MatchInNotebook, RenderableMatch, searchMatchComparer, SearchModel, SearchResult } from 'vs/workbench/contrib/search/browser/searchModel';
7575
import { createEditorFromSearchResult } from 'vs/workbench/contrib/searchEditor/browser/searchEditorActions';
7676
import { ACTIVE_GROUP, IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService';
@@ -185,7 +185,7 @@ export class SearchView extends ViewPane {
185185
@IContextMenuService contextMenuService: IContextMenuService,
186186
@IAccessibilityService private readonly accessibilityService: IAccessibilityService,
187187
@IKeybindingService keybindingService: IKeybindingService,
188-
@IStorageService storageService: IStorageService,
188+
@IStorageService private readonly storageService: IStorageService,
189189
@IOpenerService openerService: IOpenerService,
190190
@ITelemetryService telemetryService: ITelemetryService,
191191
@INotebookService private readonly notebookService: INotebookService,
@@ -257,6 +257,30 @@ export class SearchView extends ViewPane {
257257
this.isTreeLayoutViewVisible = this.viewletState['view.treeLayout'] ?? (this.searchConfig.defaultViewMode === ViewMode.Tree);
258258

259259
this._refreshResultsScheduler = this._register(new RunOnceScheduler(this._updateResults.bind(this), 80));
260+
261+
// storage service listener for for roaming changes
262+
this._register(this.storageService.onWillSaveState(() => {
263+
this._saveSearchHistoryService();
264+
}));
265+
266+
this._register(this.storageService.onDidChangeValue((v) => {
267+
if (v.key === SearchHistoryService.SEARCH_HISTORY_KEY) {
268+
const restoredHistory = this.searchHistoryService.load();
269+
270+
if (restoredHistory.include) {
271+
this.inputPatternIncludes.prependHistory(restoredHistory.include);
272+
}
273+
if (restoredHistory.exclude) {
274+
this.inputPatternExcludes.prependHistory(restoredHistory.exclude);
275+
}
276+
if (restoredHistory.search) {
277+
this.searchWidget.prependSearchHistory(restoredHistory.search);
278+
}
279+
if (restoredHistory.replace) {
280+
this.searchWidget.prependReplaceHistory(restoredHistory.replace);
281+
}
282+
}
283+
}));
260284
}
261285

262286
get isTreeLayoutViewVisible(): boolean {
@@ -2038,6 +2062,14 @@ export class SearchView extends ViewPane {
20382062
this.viewletState['view.treeLayout'] = this.isTreeLayoutViewVisible;
20392063
this.viewletState['query.replaceText'] = isReplaceShown && this.searchWidget.getReplaceValue();
20402064

2065+
this._saveSearchHistoryService();
2066+
2067+
this.memento.saveMemento();
2068+
2069+
super.saveState();
2070+
}
2071+
2072+
private _saveSearchHistoryService() {
20412073
const history: ISearchHistoryValues = Object.create(null);
20422074

20432075
const searchHistory = this.searchWidget.getSearchHistory();
@@ -2061,10 +2093,6 @@ export class SearchView extends ViewPane {
20612093
}
20622094

20632095
this.searchHistoryService.save(history);
2064-
2065-
this.memento.saveMemento();
2066-
2067-
super.saveState();
20682096
}
20692097

20702098
private async retrieveFileStats(): Promise<void> {

src/vs/workbench/contrib/search/browser/searchWidget.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,14 @@ export class SearchWidget extends Widget {
300300
return this.replaceInput?.inputBox.getHistory() ?? [];
301301
}
302302

303+
prependSearchHistory(history: string[]): void {
304+
this.searchInput?.inputBox.prependHistory(history);
305+
}
306+
307+
prependReplaceHistory(history: string[]): void {
308+
this.replaceInput?.inputBox.prependHistory(history);
309+
}
310+
303311
clearHistory(): void {
304312
this.searchInput?.inputBox.clearHistory();
305313
this.replaceInput?.inputBox.clearHistory();

src/vs/workbench/contrib/search/common/searchHistoryService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface ISearchHistoryValues {
2828
export class SearchHistoryService implements ISearchHistoryService {
2929
declare readonly _serviceBrand: undefined;
3030

31-
private static readonly SEARCH_HISTORY_KEY = 'workbench.search.history';
31+
public static readonly SEARCH_HISTORY_KEY = 'workbench.search.history';
3232

3333
private readonly _onDidClearHistory = new Emitter<void>();
3434
readonly onDidClearHistory: Event<void> = this._onDidClearHistory.event;
@@ -61,7 +61,7 @@ export class SearchHistoryService implements ISearchHistoryService {
6161
if (isEmptyObject(history)) {
6262
this.storageService.remove(SearchHistoryService.SEARCH_HISTORY_KEY, StorageScope.WORKSPACE);
6363
} else {
64-
this.storageService.store(SearchHistoryService.SEARCH_HISTORY_KEY, JSON.stringify(history), StorageScope.WORKSPACE, StorageTarget.MACHINE);
64+
this.storageService.store(SearchHistoryService.SEARCH_HISTORY_KEY, JSON.stringify(history), StorageScope.WORKSPACE, StorageTarget.USER);
6565
}
6666
}
6767
}

0 commit comments

Comments
 (0)