Comments (8)
First of all: This is Emacs using Git master, right?
Second: I'm not sure this can be fixed while maintaining full compatibility with all supported versions of Emacs.
So... Are these just warnings, or are they causing actual errors too?
from typescript.el.
First of all: This is Emacs using Git master, right?
Yes, this is a bleeding edge emacs ;)
I created this issue, because there may be performance problems in the case of large files that would be fixed by replacing the font-lock-fontify-buffer by the one suggested in the output above. See twmr/python-cell.el#8
I think the warnings above are also output on a released version of emacs, but I haven't checked it.
from typescript.el.
Feel free to try out the proposed changes in the PR. If it breaks compatibility, I'm sure the CI will let us know :)
from typescript.el.
font-lock-fontify-buffer
is already avoided on versions of Emacs that provide font-lock-ensure
, as the code surrounding the warning's location show:
"A custom predicate to help `flyspell-prog-mode' determine whether a word should be checked."
;; We depend on fontification for our results. font-lock-ensure is defined on
;; Emacs 25 and over. Earlier versions use font-lock-fontify-buffer.
(if (fboundp 'font-lock-ensure)
(font-lock-ensure)
(font-lock-fontify-buffer))
(@josteink I guess we should for typescript-mode
do the same thing you argued for tide
and have an analogue of tide--emacs-at-least
here.)
I don't know how the warnings are triggered. If the warning is issued only if font-lock-fontify-buffer
is compiled, then it may be avoidable by using conditional compilation. This might be preferable as the choice about which branch to take would be done just once during compilation. Otherwise, with-no-warnings
could be used.
syntax-begin-function
is something typescript-mode
inherited "lock, stock, and barrel" from js-mode
. AFAICT, it just became obsolete from 25.1 onwards and was not replaced with anything. I've not been able to track the whole story about it, but it's been discussed here, and the change to js-mode
was made here. It was not replaced with anything else there.
I suspect something changed in Emacs' internals that made it so that whatever information it was providing is provided through other means, and this is why it is not replaced with anything. But for us, the issue is as with font-lock-fontify-buffer
. We support old versions that assumed that this variable was present and properly set, so we cannot just remove it from the code base.
from typescript.el.
font-lock-fontify-buffer is already avoided on versions of Emacs that provide font-lock-ensure, as the code surrounding the warning's location show
Yeah. This was the reason why I asked about actual problems and not just compiler warnings.
I guess we should for typescript-mode do the same thing you argued for tide and have an analogue of tide--emacs-at-least here.
That's a good suggestion, although in this case it is fairly well documented what we're doing and why.
I don't know how the warnings are triggered. If the warning is issued only if font-lock-fontify-buffer is compiled, then it may be avoidable by using conditional compilation.
I haven't looked too deeply into this either, but that sounds plausible.
This might be preferable as the choice about which branch to take would be done just once during compilation.
On the other hand, my experience trying to uncover what was actually run in csharp-mode
(which IMO relied too heavily on compile-time constructs) makes me somewhat hesitant to recommend this route.
Maybe if we can put it in a corner, where it is equally well documented as this is?
Otherwise, with-no-warnings could be used.
I think that is a bit drastic. Warnings often show us things which we should do something about, and I'm pretty sure we've made improvements based on warnings in the past.
from typescript.el.
@josteink I meant to reply earlier, but forgot. The one thing that I feel I need to reply to is:
I think that is a bit drastic. Warnings often show us things which we should do something about, and I'm pretty sure we've made improvements based on warnings in the past.
Hmm... are we on the same page here? with-no-warnings
can be scoped to the one line that causes the warnings so:
(with-no-warnings
(setq-local syntax-begin-function #'typescript--syntax-begin-function)))
I suppose a line that is wrapped like this could someday generate additional warnings that it may be good to know about but I'd expect the risk to be fairly small.
This being said, I'm fine with not doing anything to prevent the warnings.
from typescript.el.
Hmm... are we on the same page here?
Probably not. I was replying from my phone (quite busy handling babies these days 😃 ), and assumed you meant a global compile-flag passed to the general build process.
with-no-warnings can be scoped to the one line that causes the warnings
Right. In that case I agree, and have no issues with it what so ever.
from typescript.el.
Old issue id old. Typescript is now supported in core emacs. Closing this issue.
from typescript.el.
Related Issues (20)
- Consider migrating CI to something not Travis HOT 5
- Symbol’s value as variable is void: compilation-error-regexp-alist-alist HOT 4
- Indentation hangs in `typescript--backward-to-parameter-list` when previous function has unbalanced parens
- typescript-mode hangs if I enter a newline after a dot character.
- File mode specification error: (void-function -compose) HOT 3
- typescript new keyword 'override' highlight HOT 2
- M-j in /** foo */ comment blocks is broken. Reasonbly easy to fix HOT 3
- Bump Version Tag HOT 8
- const, let formatting with multiple lines HOT 1
- Missing debugger keyword HOT 1
- Freeze on indenting dot after comma HOT 1
- `typescript-mode` is failing to download HOT 4
- Incorrect highlighting of keywords on latest commit HOT 5
- Adding mechanisms in place not to collide with in-tree typescript-mode HOT 7
- typescript 4.9 - satisfies operator HOT 1
- No option to achieve desired formatting HOT 1
- typescript--backward-to-parameter-list can cause multi-second delays in large files HOT 4
- Diagnostics don't show until file is changed HOT 1
- Thanks HOT 1
- matching closing tags in jsx in typescript-ts-mode 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 typescript.el.