-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #929 from wakatime/feature/ida-lexer
Add support for IDA family
- Loading branch information
Showing
4 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package lexer | ||
|
||
import ( | ||
"github.com/wakatime/wakatime-cli/pkg/heartbeat" | ||
|
||
"github.com/alecthomas/chroma/v2" | ||
) | ||
|
||
// IDA lexer. | ||
type IDA struct{} | ||
|
||
// Lexer returns the lexer. | ||
func (l IDA) Lexer() chroma.Lexer { | ||
return chroma.MustNewLexer( | ||
&chroma.Config{ | ||
Name: l.Name(), | ||
Aliases: []string{"IDA Pro", "IDA Free"}, | ||
Filenames: []string{"*.i64", "*.idb"}, | ||
MimeTypes: []string{"text/x-ida"}, | ||
}, | ||
func() chroma.Rules { | ||
return chroma.Rules{ | ||
"root": {}, | ||
} | ||
}, | ||
) | ||
} | ||
|
||
// Name returns the name of the lexer. | ||
func (IDA) Name() string { | ||
return heartbeat.LanguageIDA.StringChroma() | ||
} |
This file contains 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