Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LSP Segfault (Windows cmake branch) #440

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/actions/initialize-linux-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ runs:
- name: Setup OpenGL
shell: bash
run: sudo apt-get install libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxrandr-dev libxxf86vm-dev
- name: Run git fetch on vcpkg
shell: bash
run: cd "$VCPKG_INSTALLATION_ROOT" && git checkout . && git fetch && git pull && ./bootstrap-vcpkg.sh
- name: Cache Vcpkg
id: cache-vcpkg
uses: actions/cache@v3
with:
path: ~/.cache/vcpkg/archives
key: ${{ runner.os }}-vcpkg-cache
key: ${{ runner.os }}-vcpkg-cache
8 changes: 8 additions & 0 deletions .github/actions/initialize-windows-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ runs:
uses: ashutoshvarma/[email protected]
with:
version: 1.10.0
- name: Update vcpkg
shell: pwsh
run: |
Push-Location "$env:VCPKG_INSTALLATION_ROOT"
git fetch
git pull
./bootstrap-vcpkg.bat
Pop-Location
- name: Cache Vcpkg
id: cache-vcpkg
uses: actions/cache@v3
Expand Down
2 changes: 2 additions & 0 deletions include/lspserv.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ namespace AsymptoteLsp
unique_ptr<SymContextFilemap> symmapContextsPtr;
unique_ptr<unordered_map<std::string, std::vector<std::string>>> fileContentsPtr;
std::string plainFile;

std::mutex onChangeMutex;
};

class TCPAsymptoteLSPServer : public lsp::TcpServer, public AsymptoteLspServer
Expand Down
1 change: 1 addition & 0 deletions src/lspserv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ std::string wslUnix2Dos(std::string const& unixPath)

void AsymptoteLspServer::onChange(Notify_TextDocumentDidChange::notify& notify)
{
std::lock_guard lk(onChangeMutex);
logInfo("text change notification");

auto& fileChange = notify.params.contentChanges;
Expand Down
1 change: 1 addition & 0 deletions vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

"name": "asymptote",
"version": "0.0-snapshot",
"builtin-baseline": "ad3bae57455a3c3ce528fcd47d8e8027d0498add",
"dependencies": [
"zlib",
"glm",
Expand Down
Loading