mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-11 17:46:29 -05:00
VBA/VB6 code not detected in *.frm files (no syntax highlighting and not in language stats) #10413
Closed
opened 2025-11-02 09:06:48 -06:00 by GiteaMirror
·
11 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v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-rc2
v1.3.3
v1.4.0-rc1
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#10413
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @King555a on GitHub (Mar 10, 2023).
Description
When uploading a VB6 (Visual Basic 6.0) project to a repository in Gitea, *.frm files, which, among others like *.bas and *.cls, contain VB6 code, these are not affecting the language statistics bar and there is no syntax highlighting. I even tried
linguist-language=vb6to override it, which changed nothing.And I also think that the *.bas files, where syntax highlighting works, are not calculated into the statistics. I have *.bas files with many thousands of lines, but my repo is detected as 95% HTML. The HTML files have only a few hundred lines.
Sorry if this should be posted as an issue at the go-enry repo.
Gitea Version
1.18.5
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
No response
Git Version
2.39.2
Operating System
Ubuntu 18.04.6 LTS x64
How are you running Gitea?
I installed it as a package (https://gitlab.com/packaging/gitea). I also tested it at https://try.gitea.io/
Database
MySQL
@wxiaoguang commented on GitHub (Mar 11, 2023):
Gitea uses https://github.com/alecthomas/chroma , it seems that Chroma doesn't support VB.
@King555a commented on GitHub (Mar 11, 2023):
Oh, OK, I thought it's go-enry. So go-enry is just for language detection and chroma for syntax highlighting? Or am I wrong with go-enry? I'm sure I've read it anywhere, but now I can't find any hint that go-enry is used.
Nevertheless some files are obviously detected as VBA, but only a few. So something is not working 100% correctly. 😉 Regarding the syntax highlighting: I guess *.bas and *.cls have the highlighting for another language (because they are highlighted, but not 100% correctly, especially *.cls).
At this point I'm unsure where to post this issue, whether it's chroma, go-enry, gitea, ...
@wxiaoguang commented on GitHub (Mar 11, 2023):
I think you are right 😁
A recent highlighting issue is this one, maybe it could help you.
Gitea 100% depneds on Chroma to do highlighting. It's impossible to support new languages without upstream support.
And I have experiences with VB6 in old ages. IIRC, VB6 "frm" file is not pure code file, it also contains "form definition", so maybe it needs a new parser & syntax-highlighter (from upstream ....)
The problem is, TBH, VB6 is quite old (and almost dead ...), I am not sure whether upstream could support it easily.
@King555a commented on GitHub (Mar 11, 2023):
I just created a feature request issue at Chroma: https://github.com/alecthomas/chroma/issues/762
Yes, VB6 is old, but still used quite a lot. And VBA will never be old, because there is no alternative in MS Office apps. Chroma even supports QBasic, which was probably outdated about 1995. So maybe there is a chance.
And also yes, the frm files (but not cls, bas and some others) contain the form definition first, before the real code is showing.
@King555a commented on GitHub (Mar 14, 2023):
Apart from the syntax highlighting and possible problems with frm files, why does
*.bas linguist-language=vb6in the.gitattributesfile does not affect the statistics bar?vb6seems to be an alias for VBA in go-enry. Only the bas files have 900 KB in my case, while HTML files only have 90 KB and batch files have 0,5 KB, but this is the result:@King555a commented on GitHub (Apr 3, 2023):
Today I saw that since version 1.19.0 my stats show 94.5% vb6, 5.2% HTML and 0.3% VBA. I don't know what files are still detected as VBA and why HTML has this large value, but it looks better than before.
But why is the language exactly like I said in the .gitattributes file (
linguist-language=vb6)? I thought "vb6" is only an alias. So I would expect the "main" name (which would probably be VBA currently).@wxiaoguang commented on GitHub (Apr 3, 2023):
Hmm sorry, I do not know what your repository looks like so I guess I can't provide an accurate answer.
The calculation is done by:
You can take a look if you have interests. And without a reproducible example (the real repository), I guess it's difficult to figure out what it should be.
@King555a commented on GitHub (Apr 3, 2023):
Seems like the percent values are correct. I created a test repository (https://try.gitea.io/hdfiushfdidf/vb6-test) and got (almost) the same values. I also manually calculated it and it's correct. I could not believe that the HTML files are such big compared to the VB6 files. My bad.
But there must have been a change in 1.19.0. It wasn't calculated correctly before. That's good, of course, but there is also the change that the value of
linguist-languageis now taken literally. You can see it in the linked repository.According to go-enry,
vb6should show asVBA, if I'm not misunderstanding it:Also the color is wrong now. Maybe the alias names are not working at all?
@wxiaoguang commented on GitHub (Apr 4, 2023):
The color is provided by
If the language name is not recognized, then you see different colors.
@King555a commented on GitHub (Apr 4, 2023):
I just checked in my test repo and obviously I cannot use the alias names. The alias "xhtml" for "HTML" also does not work.
Should I report this at the go-enry repository?
@wxiaoguang commented on GitHub (Apr 4, 2023):
Yup if it's related to upstream