Comments (7)
This is fixed now, context is now [[gnu::hot]] int xyz()
from nvim-treesitter-context.
I think the best option would be to try to rewrite the text of the declaration so that it fits in a single line.
As for the indentation level, it should take the lowest indentation level for all lines of the declaration. So the monstrosity above would appear as:
|<--------- starts at 0
int build_stl_str_hl( win_T *wp, char_u *out, // buffer to write into != NameBuff size_t outlen, ...
But Example.method
below:
class Example {
method(x, y) {
// code
}
}
Would appear as:
|-|<---------------- starts at 2
method(x, y) {
The highlighting code in the first case becomes a bit more complex though.
from nvim-treesitter-context.
I just found out that once it finds the wrong context, it will then not find the right context. For example:
class X {
public:
[[gnu::hot]]
void xyz() {
if (something) {
} else {
}
}
private:
void other() {
// cursor is here
}
};
In this case, it will give me context relating to the function called "[[gnu::hot]]" and the conditional block within it while I am inside the other()
function. It seems to get quite stuck on this sort of thing.
from nvim-treesitter-context.
I'll try to look at it when I find time. Is this exact code example triggering the issue? Can you provide a screenshot? If possible in a new issue, yours is a bug, this is a feature request.
from nvim-treesitter-context.
I can't provide a screenshot as the code in question is company property, but I will see if I can't recreate this issue with a small snippet and post a screenshot in a new issue.
from nvim-treesitter-context.
Actually, I think this is related to the original issue and is not a bug. I may have been incorrectly reading the context before or had broken code (quite likely) without realizing it so that the parser was getting confused. However, similarly to the original issue, in this case:
[[gnu::hot]]
int xyz() {
// cursor is here
}
The context will say that I am inside a function called [[gnu::hot]]
, just like the int
in the original example. I can't seem to reproduce the issue I mentioned before, even on the exact same file, so I am willing to say I probably misinterpreted the context I was reading.
from nvim-treesitter-context.
Ok cool, so yeah it's the same issue then. I'll try to work on this when I have some time.
from nvim-treesitter-context.
Related Issues (20)
- proper support for svelte files HOT 1
- FR: Add highlights to the signcolumn / scrollbar HOT 3
- else is not displayed in context for "if else" in java HOT 1
- Markdown headers Context only shows one parent header with no highlight and other nested children... HOT 1
- not working for R code HOT 1
- Add `'TreesitterContextBottomLineNr'` highlight group HOT 2
- Context not working for python HOT 2
- Context has no highlighting when first opening Neovim HOT 4
- Add `trim_scope = "center"` HOT 1
- The `stl` setting from `'fillchars'` is being displayed in ts-context when using `'statuscolumn'` HOT 3
- context.lua:17: attempt to index local 'tree' (a nil value) HOT 3
- Context header disappears with markdown_inline parser installed HOT 1
- Disbled languages config option HOT 1
- feat: Lua API to get the status of treesitter context
- Very poor performance after “do not use vim.treesitter.highlighter” HOT 2
- Use one floating window instead of two. HOT 10
- Multi-line function definition is not handled HOT 1
- Feature Request: Formalise require('treesitter-context.context').get() API HOT 2
- Feat: tag the ts-context windows so they can be identified programmatically HOT 2
- Can this plugin be configured such that scrolloff is respected between the context and the cursor? HOT 2
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 nvim-treesitter-context.