Repository navigation
feat: extract strings across a folder or the whole workspace - #47
Merged
Merged
Conversation
Extract read the one open document. Extract Strings from Workspace and Extract Strings from Folder read many files from disk. The folder command is also on a folder in the Explorer, and asks for one when run from the palette. The report is the distinct strings, the most widely used first, with how often each is written, in how many files, and where. Positions follow showPositions as they do for Extract. A file its format reader could not parse is listed with the reason. A string longer than 120 characters, or one with a line break, is shown as one cut line, and two strings are still compared whole. src/workspace is the same three files as in ids-le, byte for byte, and the scan settings are the eight urls-le has. Commands, settings and messages are translated into the twelve languages the extension ships.
Most strings in a project are written once, and each got a heading and a file list of its own. On a real project of 2,651 distinct strings the report ran to 14,112 lines. A string written once is now placed in a Where column of its row. Only a repeated string gets a section listing each place. Every string is still in the table, and the same project reports in 5,532 lines.
| // Most strings in a project are written once. Such a one is placed in | ||
| // its row, so the sections below are only the repeated ones. | ||
| for (const entry of strings) { | ||
| const row = `| ${shown(entry.value).replace(/\|/g, '\\|')} | ${entry.occurrences.length} | ${filesOf(entry.occurrences).length} |`; |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The folder scan for String-LE. See
FOLDER-SCAN.mdin letools-site.String-LE: Extract Strings from WorkspaceString-LE: Extract Strings from FolderThe report, the eight scan settings and the positions behaviour are as in urls-le.
What differs
src/workspaceis byte-identical to ids-le's. A test holds the README's sample to what a scan really prints. Everything is translated into all twelve languages. Changelog entries are in the 2.5.0 section. No version bump.