Closed TortoiseHive closed 2 years ago
What is the declaration of juniorToken?
What is the declaration of juniorToken?
JuniorToken public juniorToken;
JuniorToken is a ERC20 contract.
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.7 <0.9.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract JuniorToken is ERC20 {
constructor (string memory _name, string memory _symbol, uint256 _amount) ERC20(_name, _symbol) {
_mint(msg.sender, _amount);
}
}
Inside JuniorToken i can use the LSP
I got it. That's what I say the LS has no tolerance.
You need type juniorToken;
first (to make syntax correct ), then type .
after juniorToken
. Just like:
I have to say this is a bit inconvenient. But I still decided to develop new lsp. Because official compiler is more reliable.
This problem can resolve with error recovery. Although it is not easy to implement.
I got it. That's what I say the LS has no tolerance.
You need type
juniorToken;
first (to make syntax correct ), then type.
afterjuniorToken
. Just like:![]()
I have to say this is a bit inconvenient. But I still decided to develop new lsp. Because official compiler is more reliable.
My JuniorToken already is ERC20, it have the ERC20 methods:
contract JuniorToken is ERC20 {
The LSP of coc-solidity@0.1.0 could detect the methods.
Just to be clear:
I have two files:
Lending and JuniorToken.
Lending have:
juniorToken = new JuniorToken(string(abi.encodePacked(_tokenName, " jr")),
string(abi.encodePacked("J", _tokenSymbol)), _juniorAmount);
the juniorToken already have a type, is a global variable of lending.
u didn't get my point. I'm talking about syntax tolerance.
(im calling inside the lending)
even with ; i dont get the transfer in LS.
With coc-solidity@0.1.0 in same place:
can you give me a demo project to reproduce this issue?
just some minimal codes to reproduce this issue.
just some minimal codes to reproduce this issue.
Here:
https://github.com/TortoiseHive/test-coc-solidity
Use the contracts/Lending.sol to do the test.
Actual COC:
0.1.0 (appears 3 times, its strange):
that awkward D:
Maybe something in my OS?
Can you test with my the config i use?
https://github.com/otavioschwanck/mood-nvim
My CocInfo:
## versions
vim version: NVIM v0.7.0-dev+1245-gf291a0339
node version: v14.18.1
coc.nvim version: 0.0.80-c9f7aa24 2022-03-24 23:11:36 +0800
coc.nvim directory: /Users/otavio/.local/share/nvim/site/pack/packer/start/coc.nvim
term: iTerm.app
platform: darwin
## Log of coc.nvim
2022-03-25T02:17:44.439 INFO (pid:57233) [services] - registered service "languageserver.dls"
2022-03-25T02:17:44.522 INFO (pid:57233) [plugin] - coc.nvim initialized with node: v14.18.1 after 152ms
2022-03-25T02:17:46.429 INFO (pid:57233) [attach] - receive notification: highlight []
2022-03-25T02:17:54.536 INFO (pid:57233) [services] - registered service "solidity"
2022-03-25T02:17:54.537 INFO (pid:57233) [services] - Solidity Language Server state change: stopped => starting
2022-03-25T02:17:54.575 INFO (pid:57233) [core-watchman] - watchman watching project: /Users/otavio/demo-for-coc-solidity
2022-03-25T02:17:54.814 INFO (pid:57233) [attach] - receive notification: highlight []
2022-03-25T02:17:56.866 INFO (pid:57233) [attach] - receive notification: highlight []
2022-03-25T02:17:57.695 INFO (pid:57233) [attach] - receive notification: highlight []
2022-03-25T02:17:58.527 INFO (pid:57233) [services] - Solidity Language Server state change: starting => running
2022-03-25T02:17:58.528 INFO (pid:57233) [services] - service solidity started
2022-03-25T02:18:00.183 INFO (pid:57233) [attach] - receive notification: showInfo []
Did you use the same remapping that i ?
EDIT:
Is working now somehow (just in this demo project). On my main project it doesn't work. i will figure it out why tomorrow
I think you still haven't got the point .
The point is tolerance.
I think you still haven't got the point .
i got, i need the ;
I think you still haven't got the point .
I just pushed a new commit to the repository.
If some warning is present, this part stop working, probabily some error in LSP, not in coc.
EDIT:
Ignore, its not happening when i remove too. Dont know how to reproduce =/
Demo video:
its very random, sometimes works, sometimes not (most of time not)
member completion trigger by .
, so u need delete .
first, and then type .
again.
Got it, now is working.
Working perfectly <3 Super thanks!
This new LS (solc) is good, but have some limitations:
new:![image](https://user-images.githubusercontent.com/100160179/159956186-083f2977-8a1e-450d-b47e-0c39c343042a.png)
old:![image](https://user-images.githubusercontent.com/100160179/159956658-5339596d-d92d-4918-a91e-2069c5e12c66.png)
It worth to keep this new LS?