Comments (4)
Seems reasonable, how could we do this in a backwards compatible manner?
from chroma.
Maybe this?
lexer, certainty := lexers.AnalyseScore("package main\n\nfunc main()\n{\n}\n")
Possibly in combination with deprecating the existing function since it's sort of unpredictable.
from chroma.
In what way is it unpredictable?
from chroma.
Not sure if "unpredictable" is the right word, but let's say:
- I get a file
lexers.Analyse()
says it's a C program, with 1% confidence
This means that even though C is the "best" guess, it's still a bad guess, and it might be better to not highlight at all.
That's why I'd like to have the confidence number as well to be able to make this judgement.
from chroma.
Related Issues (20)
- Would you accept new lexers? HOT 1
- Support EDN syntax highlighting HOT 2
- Line feed following printable character is detected as an error for VimL HOT 5
- C++ comments not recognized HOT 2
- Duplicate lexer entry HOT 3
- `react` lexer should be merged into `javascript` HOT 1
- Org mode tokenizer removes newline
- Support WithLinkableLineNumberRanges() HOT 1
- Support Justfile HOT 3
- Lexer conversion from Textmate? HOT 2
- Playground is offline HOT 1
- SQF (Arma3,DayZ) code support
- Running tests with RECORD=true leaves a non-clean working tree HOT 1
- CUE HOT 3
- Helping review change to the CUE lexer HOT 3
- Add a line protocol syntax lexer
- Language parameter to the playground HOT 2
- No theme background color in TTY formatters HOT 2
- Syntax highlight for log extension files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chroma.