Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple tags files (and other improvements) #48

Merged
merged 3 commits into from
Mar 13, 2024

Conversation

friedbrice
Copy link
Contributor

@friedbrice friedbrice commented Mar 12, 2024

Co-requisite with https://github.com/MercuryTechnologies/mercury-web-backend/pull/26568

  • DUX-2035: Configure grep path.
  • DUX-2037: Support merging of workspace and fallback config.
  • DUX-2041: Support multiple tags files.

@michaelkitson
Copy link

Just as an option to consider if you haven't, it seems like it might be possible to just not use PCRE syntax in the regex? I think \t is the only PCRE thing you're using, and could be replaced with a literal tab.

Just a thought, not well researched.

@friedbrice
Copy link
Contributor Author

Thanks, @michaelkitson! I'll try that.

src/config.ts Outdated
Comment on lines 298 to 319
function languageMerge(mask: LanguageConfig, base: LanguageConfig): LanguageConfig {
return {
languageId: mask.languageId,
serverCommand: mask.serverCommand || base.serverCommand,
formatCommand: mask.formatCommand || base.formatCommand,
apiSearchUrl: mask.apiSearchUrl || base.apiSearchUrl,
tags: arrayMerge(mask.tags || [], base.tags || [], tag => tag.file, tagMerge),
annotations: arrayMerge(mask.annotations || [], base.annotations || [], ann => ann.file, (mask, base) => mask)
}
}

function tagMerge(mask: TagsConfig, base: TagsConfig): TagsConfig {
return {
file: mask.file,
grepPath: mask.grepPath,
initTagsCommand: mask.initTagsCommand || base.initTagsCommand,
refreshTagsCommand: mask.refreshTagsCommand || base.refreshTagsCommand,
completionsProvider: mask.completionsProvider || base.completionsProvider,
definitionsProvider: mask.definitionsProvider || base.definitionsProvider,
importsProvider: mask.importsProvider || base.importsProvider
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

Copy link

@azuzunaga azuzunaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome. Let me know when it's ready for review and I'll stamp.

@friedbrice friedbrice marked this pull request as ready for review March 12, 2024 22:56
@friedbrice
Copy link
Contributor Author

@michaelkitson I'm going to go with requiring GNU Grep, because I spent too much time pulling my hair out trying to figure out a CLI invocation that worked for both GNU Grep and BSD Grep -_-

@friedbrice friedbrice requested a review from azuzunaga March 12, 2024 22:57
@friedbrice friedbrice changed the title Configure grep path Multiple tags files (and other improvements) Mar 12, 2024
@friedbrice friedbrice merged commit 11519f5 into main Mar 13, 2024
1 check passed
@friedbrice friedbrice deleted the daniel/configure-grep-path branch March 13, 2024 15:36
Copy link

A PR to release these changes has been created, bumping the version from 2.6.0 to 3.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants