eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
19.54k stars 2.46k forks source link

Fix performance issues in terminal #13735

Closed AlexandraBuzila closed 1 month ago

AlexandraBuzila commented 1 month ago

What it does

Do not search for matches in the workspace when creating links in the terminal, as this impacts performance in large workspaces. Instead, search for a match only when the user wants to open a link. If the match can't be found, open the quick input service and let the user select from a list of possible matches.

Additionally, the LocalFileLinkProvider no longer matches single words, to avoid polluting the terminal with links.

Fixes #13712 Fixes #13576

Contributed on behalf of STMicroelectronics

How to test

Open a workspace and echo some partial paths in the terminal. All paths that can be resolved to a workspace file should have valid links that can be used to open the files from the terminal, e.g.:

../../packages/terminal/src/browser/terminal-file-link-provider.ts:17:20 src/browser/terminal-file-link-provider.ts

For links that can't be matched in the workspace, the quick input widget is opened.

In large workspaces, this should not affect performance and rg should be running only when a terminal link is clicked.

Follow-ups

Review checklist

Reminder for reviewers

JonasHelming commented 1 month ago

@tsmaeder I would love to get this int the release beginning of next week.