Skip to content
This repository was archived by the owner on Oct 9, 2021. It is now read-only.

Commit 1290ed9

Browse files
committed
detect ColdFusion as root language instead of HTML
1 parent 0f8f76a commit 1290ed9

3 files changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<cflock name="FileOperation" timeout="20" throwOnTimeout="true">
2+
<cffile action="write" file="#filePath#" output="#content#">
3+
</cflock>
4+
<!-- application scope is exclusively locked on the cache -->
5+
<cflock type="readonly" scope="application" timeout="10" throwOnTimeout="true">
6+
<cfset myVar = application.cache.getValue("x")>
7+
</cflock>
8+
<cfquery name="variables.qUser" datasource="#request.dsn#">
9+
SELECT FirstName, LastName
10+
FROM Users
11+
WHERE UserID = #request.UserID#
12+
</cfquery>
13+
<cflock scope="application" timeout="2" type="exclusive">
14+
<cfset application.qUser=variables.qUser>
15+
</cflock>

tests/test_languages.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,9 @@ def test_go_mod_detected(self):
280280
expected_language='Go',
281281
entity='go.mod',
282282
)
283+
284+
def test_coldfusion_detected(self):
285+
self.shared(
286+
expected_language='ColdFusion',
287+
entity='coldfusion.cfm',
288+
)

wakatime/stats.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,12 @@ def get_lexer(language):
259259

260260

261261
def use_root_language(language, lexer):
262+
override = {
263+
'Coldfusion HTML': 'ColdFusion',
264+
}
265+
if language in override:
266+
return override[language]
267+
262268
if lexer and hasattr(lexer, 'root_lexer'):
263269
return u(lexer.root_lexer.name)
264270

0 commit comments

Comments
 (0)