MaskRay / vscode-ccls

ccls plugin for Visual Studio Code
123 stars 37 forks source link

auto change -> and . on macro worked not well #78

Open findNextStep opened 5 years ago

findNextStep commented 5 years ago

when we have code like below

#include <gtest/test.h>

struct foo{
int a;
int b;
};
TEST(some_test,test_case){
foo* s;
EXPECT_EQ(s.|   ,val2)
}

and use tab to auto complete ccls will change . to -> that is amazing but code change to

->#include <gtest/gtest.h> // seem change happens here

struct foo{
int a;
int b;
};
TEST(some_test,test_case){
foo* s;
EXPECT_EQ(s.a   ,val2)
}

I have no idea that is a bug about ccls or vscode-ccls so i come here here is some setting that may useful

"ccls.cache.directory": ".ccls-cache-vscode",
  "ccls.completion.detailedLabel": true,
  "ccls.launch.args": [
    "-log-file=/tmp/ccls_realx.log",
    "--init={\"capabilities\": {\"foldingRangeProvider\": false}}",
  ],
  "ccls.completion.duplicateOptional": true,
  "ccls.completion.enableSnippetInsertion": true,
  "ccls.diagnostics.onChange": 200,
  "ccls.misc.compilationDatabaseDirectory": "build",
  "ccls.clang.extraArgs": [
    "-isystem",
    "/Library/Developer/CommandLineTools/usr/include/c++/v1",
  ],
  "ccls.clang.resourceDir": "/usr/local/Cellar/llvm/9.0.0/lib/clang/9.0.0",

System information