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

Add support for IDA family #929

Merged
merged 1 commit into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pkg/heartbeat/language.go
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,8 @@ const (
LanguageHyPhy
// LanguageIcon represents the Icon programming language.
LanguageIcon
// LanguageIDA represents the IDA programming language.
LanguageIDA
// LanguageIDL represents the IDL programming language.
LanguageIDL
// LanguageIdris represents the Idris programming language.
Expand Down Expand Up @@ -1888,6 +1890,7 @@ const (
languageHybrisStr = "Hybris"
languageHyPhyStr = "HyPhy"
languageIconStr = "Icon"
languageIDAStr = "IDA"
languageIDLStr = "IDL"
languageIdrisStr = "Idris"
languageIgnoreListStr = "Ignore List"
Expand Down Expand Up @@ -3047,6 +3050,8 @@ func ParseLanguage(s string) (Language, bool) {
return LanguageHyPhy, true
case normalizeString(languageIconStr):
return LanguageIcon, true
case normalizeString(languageIDAStr):
return LanguageIDA, true
case normalizeString(languageIDLStr):
return LanguageIDL, true
case normalizeString(languageIdrisStr):
Expand Down Expand Up @@ -4725,6 +4730,8 @@ func (l Language) String() string {
return languageHyPhyStr
case LanguageIcon:
return languageIconStr
case LanguageIDA:
return languageIDAStr
case LanguageIDL:
return languageIDLStr
case LanguageIdris:
Expand Down
1 change: 1 addition & 0 deletions pkg/heartbeat/language_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ func languageTests() map[string]heartbeat.Language {
"Hybris": heartbeat.LanguageHybris,
"HyPhy": heartbeat.LanguageHyPhy,
"Icon": heartbeat.LanguageIcon,
"IDA": heartbeat.LanguageIDA,
"IDL": heartbeat.LanguageIDL,
"Idris": heartbeat.LanguageIdris,
"Ignore List": heartbeat.LanguageIgnoreList,
Expand Down
32 changes: 32 additions & 0 deletions pkg/lexer/ida.go
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()
}
1 change: 1 addition & 0 deletions pkg/lexer/lexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ func RegisterAll() error {
INI{},
IRCLogs{},
Icon{},
IDA{},
Inform6{},
Inform6Template{},
Inform7{},
Expand Down
Loading