Skip to content

Commit f2ac4ae

Browse files
Add C# plugin specific restrictions to documentation (#817)
Co-authored-by: Máté Cserép <mcserep@gmail.com>
1 parent b929fe2 commit f2ac4ae

2 files changed

Lines changed: 53 additions & 4 deletions

File tree

doc/usage.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,3 +304,12 @@ To access this feature, requests must be sent to the following address:
304304
e.g.: [`http://localhost:6251/MyProject/CppLspService`](http://localhost:6251/MyProject/CppLspService)
305305

306306
The project name should match the name of the project used by the CodeCompass_parser.
307+
308+
### C# specific remarks
309+
310+
The C# parser is still in an experimental phase.
311+
There are some considerations that should be taken into account, when parsing a C# project:
312+
313+
- The C# parser currently supports parsing only a single project.
314+
- The C# parser currently supports only PostgreSQL as a database backend, not SQLite.
315+
- The path to the output build directory (e.g. to the `bin/Release/` folder) shall also be specified through the `-b` flag, when executing the `CodeCompass_parser` command.

docker/README.md

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Table of Contents
3030
* [Development](#development)
3131
* [Build image for development](#build-image-for-development)
3232
* [How to use docker to develop CodeCompass](#how-to-use-docker-to-develop-codecompass)
33+
* [Use PostgreSQL and run it in a separate container](#use-postgresql-and-run-it-in-a-separate-container)
3334
* [Build, install and test CodeCompass](#build-install-and-test-codecompass)
3435
* [How to parse a project](#how-to-parse-a-project)
3536
* [How to start a webserver](#how-to-start-a-webserver)
@@ -67,13 +68,52 @@ docker run --rm -ti \
6768
codecompass:dev \
6869
/bin/bash
6970
```
71+
7072
This container will be used in the next subsections to build CodeCompass,
7173
parse a project and start a webserver.
7274

7375
*Note*: you do not have to give the `--publish` option and set the `DATABASE`
7476
environment variable if you do not want to run a webserver. Also you do not
7577
have to mount a project directory if you do not want to parse it later.
7678

79+
### Use PostgreSQL and run it in a separate container
80+
Alternatively, instead of SQLite, you may want to ue PostgreSQL and run the database
81+
engine in a Docker container as well:
82+
```bash
83+
docker run --rm -ti \
84+
--env DATABASE=pgsql \
85+
--env TEST_DB="postgresql://postgres:password@postgres_container:5432/postgres" \
86+
--env BUILD_TYPE=Release \
87+
--volume /path/to/host/CodeCompass:/CodeCompass \
88+
--volume /path/to/your/host/project:/projects/myproject \
89+
-p 8001:8080 \
90+
codecompass:dev \
91+
/bin/bash
92+
```
93+
94+
You need to create a PostgreSQL container that CodeCompass can communicate with:
95+
```bash
96+
docker run \
97+
--name postgres_container \
98+
-e POSTGRES_PASSWORD=root_password \
99+
-d \
100+
-p 5432:5432 \
101+
postgres:15
102+
```
103+
104+
You also need to create a Postgres user and give it admin rights:
105+
```bash
106+
# Create user "your_user" with password "your_password" and give Superuser rights
107+
docker exec -it postgres_container psql -U postgres -d postgres -c "CREATE USER your_user WITH PASSWORD 'your_password' SUPERUSER;"
108+
```
109+
110+
Finally, create a network and connect CodeCompass and Postgres to it:
111+
```bash
112+
docker network create my_network
113+
docker network connect my_network postgres_name
114+
docker network connect my_network codecompass_container
115+
```
116+
77117
### Build, install and test CodeCompass
78118
You can use the `codecompass-build.sh` script inside the container to build,
79119
install and test CodeCompass:
@@ -88,8 +128,11 @@ codecompass-build.sh install
88128
codecompass-build.sh test
89129
```
90130

131+
*Note*: if you get a timeout error when downloading, add these variable definitions before install:
132+
`NODE_OPTIONS="--max-old-space-size=4096" NEXT_PRIVATE_BUILD_WORKER_TIMEOUT=600`
133+
91134
### How to parse a project
92-
You can parse a project inside a docker container by using the following
135+
You can parse a project (after building it) inside a docker container by using the following
93136
command:
94137
```bash
95138
CodeCompass_parser \
@@ -104,9 +147,6 @@ CodeCompass_parser \
104147
### How to start a webserver
105148
You can start a webserver inside the container by using the following command:
106149
```bash
107-
# Create a workspace directory.
108-
mkdir -p /CodeCompass/workspace
109-
110150
# Run the web server.
111151
CodeCompass_webserver \
112152
-w /CodeCompass/workspace

0 commit comments

Comments
 (0)