Sclang: The language client is inconsistent with its use of flushing the main post buffer
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
The issue names postChar and postText and describes flushing in the language client, but does not name source files or tests. Start by locating these functions and reading the compiler rewrite plan and language client code. Done means the rewrite uses separate normal and error streams and modern formatting as described; the issue says this work belongs with the compiler rewrite, so confirm that effort is underway before starting.
Written by the indexing model from the issue text.
Description
Motivation
When you flush, you probably do a system call, you should avoid it until the end.
When printing characters, the language clients flushes after each...
void postChar(char c) {
SC_LanguageClient* client = SC_LanguageClient::lockedInstance();
if (client)
// TODO: why is this flush? Surely if we are writing single characters this is the most inefficient way to do this?
client->postFlush(&c, sizeof(char));
SC_LanguageClient::unlockInstance();
}
When calling postText we also flush.
void postText(const char* str, std::size_t len) {
SC_LanguageClient* client = SC_LanguageClient::lockedInstance();
if (client){
// TODO: why don't we call client->postText?
client->postFlush(str, len);
}
SC_LanguageClient::unlockInstance();
}
Additionally it is assumed the error and normal post streams are the same and only one flush is provided.
These should be completely rewritten and real streams used. There is no need to expose a c interface for this, no one but us is writing their own language client, just use normal cpp streams for this.
We should also remove the nasty c var* functions and replace this with a modern format library (FMT). These will still be needed because unfortunately the class library uses the syntax 😒
Plan for Implementation
This should be done as part of the compiler rewrite, language clients needs a rethink when we do language servers anyway. Also, the language client should be able to decide where it prints errors and normal messages, therefore, we need separate streams — this should also be applied to the class library, so we might need some new printing functions here, or maybe a new class like Post, but ErrorPost.
- Dominant language
- C++
- Stars
- 6.8k
- Forks
- 854
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 16
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from supercollider/supercollider
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 82/100
supercollider/supercollider#7872 · 1 comment ·
Maintainers usually reply within 1 day
-
comp: server plugins
Difficulty 1/5 1-3 hours Newbie friendliness 69/100
supercollider/supercollider#7860 · 1 reaction ·
Maintainers usually reply within 1 day
-
Fix minor problems in docsPossibly taken @Chr0mium24 claimed this 12 days ago. Openbug comp: help good-first-issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
supercollider/supercollider#7853 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
supercollider/supercollider#7726 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 75/100
supercollider/supercollider#7724 ·
Maintainers usually reply within 1 day
All issues in supercollider/supercollider
Similar issues
-
launcher: settings are never saved on macOS — QSettings SystemScope points to /Library/PreferencesOpen
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA-RTX/ShaderMake#29 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
yetanotherbrowser/yab#1062 ·
Maintainers usually reply within 1 day
-
bug I/O low priority semantics
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day