search additionalLanguages for language spec#42055
Conversation
`javascript` is an `additionalLanguage` in the `typescript` language spec. When looking for a language spec by languageID, we need to also search the `additionalLanguages`. Fixes https://github.com/sourcegraph/sourcegraph/issues/41745.
olafurpg
left a comment
There was a problem hiding this comment.
LGTM. I’m away from the computer until Tuesday so I can’t test this locally, but this looks like a very safe diff to merge and patch.
|
@olafurpg OK, thanks. I will merge this so that we can get it deployed on Sourcegraph.com and fix the issue there. I'll separately ensure another code intel team member follows up on Monday morning to see about patching this into 4.0 and what else (if anything) is needed to fix this issue comprehensively. cc @lguychard |
chrismwendt
left a comment
There was a problem hiding this comment.
LGTM2, this essentially restores the code from prior to https://github.com/sourcegraph/sourcegraph/pull/41128, specifically this part:
|
@chrismwendt (https://github.com/sourcegraph/sourcegraph/pull/42055#pullrequestreview-1119456090):
Do you or @olafurpg know why the lookup in |
|
I don't know, maybe it was some kind of copy-paste mistake. |
`javascript` is an `additionalLanguage` in the `typescript` language spec. When looking for a language spec by languageID, we need to also search the `additionalLanguages`. Fixes https://github.com/sourcegraph/sourcegraph/issues/41745.
|
I don't think this was caused by a copy-paste mistake. The From what I can tell, additional languages were only used by the extension template generator to register an export const activate = async (context: sourcegraph.ExtensionContext = DUMMY_CTX): Promise<void> => {
const languageSpec = languageSpecs.find(spec => spec.languageID === languageID)
if (languageSpec === undefined) {
throw new Error(`Unknown language ${languageID}`)
} |
|
@sqs Nice job finding the root cause of the issue! I spent a while trying to understand the root cause of the problem before opening the but didn't understand what was going on |
`javascript` is an `additionalLanguage` in the `typescript` language spec. When looking for a language spec by languageID, we need to also search the `additionalLanguages`. Fixes https://github.com/sourcegraph/sourcegraph/issues/41745.


javascriptis anadditionalLanguagein thetypescriptlanguage spec. When looking for a language spec by languageID, we need to also search theadditionalLanguages.NOTE: I haven't thoroughly tested this, and I don't have much experience in this part of the codebase. This PR should be taken over by a code intel team member.
Fixes https://github.com/sourcegraph/sourcegraph/issues/41745.
Test plan
TBD, on https://sourcegraph.test:3443/github.com/sourcegraph/sourcegraph/-/blob/gulpfile.js?L37:3#tab=references :

App preview:
Check out the client app preview documentation to learn more.