Skip to content

Commit

Permalink
Make C++ Intellisense work + docker container fixes for it (#324)
Browse files Browse the repository at this point in the history
* Fixing missing commas, and whitespace problems

* Fixing the C++ IntelliSense, updating the dockerfile
  • Loading branch information
woody-apple authored Apr 10, 2020
1 parent a3c07d0 commit cc9467c
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 12 deletions.
10 changes: 8 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@ RUN apt-get -fy install git vim emacs sudo \
iproute2 procps lsb-release \
bash-completion \
build-essential cmake cppcheck valgrind \
wget curl telnet

wget curl telnet bsdtar
RUN groupadd --gid $USER_GID $USERNAME
RUN useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME
RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME
RUN chmod 0440 /etc/sudoers.d/$USERNAME

RUN ln -s /usr/bin/clang-format-9 /usr/local/bin/clang-format

RUN mkdir -p /var/downloads
RUN cd /var/downloads
RUN curl -JL https://github.com/microsoft/vscode-cpptools/releases/download/0.27.0/cpptools-linux.vsix | bsdtar -xvf - extension
RUN mkdir -p /home/vscode/.vscode-server/extensions
RUN mv extension /home/vscode/.vscode-server/extensions/ms-vscode.cpptools-0.27.0
RUN chown -R vscode:vscode /home/vscode
18 changes: 9 additions & 9 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"remoteUser": "vscode",
// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": [
"ms-vscode.cpptools",
"ms-azuretools.vscode-docker",
"xaver.clang-format",
"github.vscode-pull-request-github",
"maelvalais.autoconf",
"yzhang.markdown-all-in-one",
"eamodio.gitlens",
"yuichinukiyama.vscode-preview-server"
],
"ms-azuretools.vscode-docker",
"xaver.clang-format",
"github.vscode-pull-request-github",
"maelvalais.autoconf",
"yzhang.markdown-all-in-one",
"eamodio.gitlens",
"yuichinukiyama.vscode-preview-server",
"aaron-bond.better-comments"
],
// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.vscode/*
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/settings.json

# Build System
.deps
Expand Down Expand Up @@ -36,4 +37,4 @@ src/include/BuildConfig.h.in
third_party/nlassert/
third_party/nlfaultinjection/
third_party/nlio/
third_party/nlunit-test/
third_party/nlunit-test/
106 changes: 106 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"C_Cpp.intelliSenseEngineFallback": "Enabled",
"C_Cpp.default.includePath": [
"${workspaceFolder}/build/default/src/",
"${workspaceFolder}/build/default/src/**",
"${workspaceFolder}/build/default/src/include/**",
"${workspaceFolder}/build/default/src/lib/**",
"${workspaceFolder}/build/config/standalone/",
"${workspaceFolder}/build/config/standalone/**",
"${workspaceFolder}/src/**",
"${workspaceFolder}/src/include/",
"${workspaceFolder}/src/include/**",
"${workspaceFolder}/src/lib/**",
"${workspaceFolder}/src/system/**",
"${workspaceFolder}/third_party/nlassert/repo/include/**",
"${workspaceFolder}/third_party/nlio/repo/include/**"
],
"[cpp]": {
"editor.defaultFormatter": "xaver.clang-format"
},
"files.associations": {
"iostream": "cpp",
"array": "cpp",
"atomic": "cpp",
"*.tcc": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"optional": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iosfwd": "cpp",
"istream": "cpp",
"limits": "cpp",
"new": "cpp",
"ostream": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"cinttypes": "cpp",
"typeinfo": "cpp"
},
"files.eol": "\n",
"editor.formatOnSave": true,
"better-comments.tags": [
{
"tag": "!",
"color": "#FF2D00",
"strikethrough": false,
"backgroundColor": "transparent"
},
{
"tag": "?",
"color": "#3498DB",
"strikethrough": false,
"backgroundColor": "transparent"
},
{
"tag": "//",
"color": "#474747",
"strikethrough": true,
"backgroundColor": "transparent"
},
{
"tag": "todo",
"color": "#FF8C00",
"strikethrough": false,
"backgroundColor": "transparent"
},
{
"tag": "fixme",
"color": "#FF8C00",
"strikethrough": false,
"backgroundColor": "transparent"
},
{
"tag": "*",
"color": "#98C379",
"strikethrough": false,
"backgroundColor": "transparent"
}
],
"clang-format.fallbackStyle": "WebKit"
}

0 comments on commit cc9467c

Please sign in to comment.