Feature: Support more languages in source view.
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cpp, javascript, rust, typescript
- Domain
- frontend
Research direction
The language choice lives in src/components/shared/SourceView-codemirror.ts, where the switch hardcodes JavaScript, Rust and C++ (lines 49-79 at the linked commit). Read that switch, then check how CodeMirror's LanguageDescription.matchFilename could be called from the file name before the JavaScript fallback. Done when a source file with another extension, such as .py, gets syntax highlighting while the existing JS, Rust and C++ cases still work.
Written by the indexing model from the issue text.
Description
Since processed profile json version 64 its possible to include source code of various languages in the profile json. It would be far nicer if this source code was able to be syntax highlighted, at least for all languages supported by CodeMirror.
The current syntax highlighting switch hardcodes js, rust, and cpp:
https://github.com/firefox-devtools/profiler/blob/f3c1c766e85154725ed7c1c4ecdf7d4aa9136892/src/components/shared/SourceView-codemirror.ts#L49-L79
Codemirror supports filename matching across all its built in languages: https://codemirror.net/docs/ref/#language.LanguageDescription^matchFilename
I think, mostly the task would be to actually call this before falling back to javascript.
The profile for screenshot:
ffprofile.json
┆Issue is synchronized with this Jira Task
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 498
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 39
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from firefox-devtools/profiler
-
Add a section for about:logging in our user docsPossibly taken @ShryukGrandhi claimed this 13 days ago. Opendocumentation
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
firefox-devtools/profiler#6310 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
firefox-devtools/profiler#6110 ·
Maintainers usually reply within 1 day
-
profile data
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
firefox-devtools/profiler#5971 · 1 comment ·
Maintainers usually reply within 1 day
-
Automate the remaining deployment stepsPossibly taken @fatadel claimed this 2 days ago. Open
firefox-devtools/profiler#6435 · 1 assignee ·
Maintainers usually reply within 1 day
-
Can't search in source viewPossibly taken @mstange claimed this 14 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 55/100
firefox-devtools/profiler#6412 ·
Maintainers usually reply within 1 day
All issues in firefox-devtools/profiler
Similar issues
-
[fullsend] E2E: scorecard — filecheck GitLab entity metrics unavailable due to initialDelay timingOpene2e-failure ready-to-code
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
redhat-developer/rhdh-plugin-export-overlays#4698 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
devswha/herdr-web-ui#2884 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
b:minor bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
software-mansion/argent#1771 ·
Maintainers usually reply within 1 day
-
Resources: New palettes of XiamenPossibly taken @rmt-svc claimed this today. Openresources
Difficulty 1/5 1-3 hours Newbie friendliness 74/100
railmapgen/rmg-palette#2491 ·
Maintainers usually reply within 4 days