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

Use "OUTPUT" for the "Compile Active File" task #4012

Open
ujos opened this issue Aug 27, 2024 · 13 comments
Open

Use "OUTPUT" for the "Compile Active File" task #4012

ujos opened this issue Aug 27, 2024 · 13 comments
Labels
enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: build
Milestone

Comments

@ujos
Copy link

ujos commented Aug 27, 2024

Feature Request

Could you change the "Compile Active File" task (the button at the top-right of the opened C++ file) to report the g++ output to the OUTPUT tab rather than to TERMINAL?

The reason is because it is inconvenient to navigate upon the errors and warnings inside the TERMINAL tab. Home and End buttons actually move the cursor to the begin/end of the command line at the bottom of the tab rather than scroll the compilation output top/down. And PgUp/PgDown also do not scroll up/down.

PS. Previously I posted this issue to VS Code. They say it has to be moved here. Please excuse me if that is the wrong place again. I just do not know which plugin created the "Compile Active File" button.

@bobbrow
Copy link
Member

bobbrow commented Aug 27, 2024

@ujos I just commented on your issue in the vscode repo. The short answer is that I don't think we can redirect output from the tasks to go to the OUTPUT tab unless VS Code added a feature to do that. However, they had a good point that you should be able to see the warnings and errors in the PROBLEMS tab. Does that feature work for you?

@ujos
Copy link
Author

ujos commented Aug 27, 2024

@bobbrow Sometimes the PROBLEMS tab is missing the errors and the OUTPUT/TERMINAL is only the option to find the reason of the compiler error. Maybe that is because the output text from the compiler in the TERMINAL tab is too long. Maybe that is another issue, not related to this one.

@ujos
Copy link
Author

ujos commented Aug 27, 2024

Please try to put this code into the text editor and press "Compile Active File"

#include<bits/stdc++.h>

template<typename S>
void foo(S& s)
{
    s << s;
}

int main()
{
    std::stringstream ss;
    foo(ss);
}

@bobbrow
Copy link
Member

bobbrow commented Aug 27, 2024

Thanks for the code snippet. I misread your initial report and assumed that you were using the "Build and Debug" button, not the "Compile Active File" button (which is owned by CMake Tools). Using the "Build and Debug" button, I do see problems being added to the PROBLEMS tab, but with "Compile Active File", I do not. I'm moving this issue over to CMake Tools for them to take a look.

@bobbrow bobbrow transferred this issue from microsoft/vscode-cpptools Aug 27, 2024
@github-project-automation github-project-automation bot moved this to Blocked in CMake Tools Aug 27, 2024
@ujos
Copy link
Author

ujos commented Aug 27, 2024

Thank you @bobbrow very much for assistance

@Evelyn-001 Evelyn-001 added enhancement an enhancement to the product that is either not present or an improvement to an existing feature and removed triage labels Aug 28, 2024
@Evelyn-001
Copy link
Collaborator

Thanks for reporting this issue. With "Compile Active File", g++ output to the TERMINAL tab now. Our development team will investigate this issue further. We will get back to you if there is any update. Thank you for your support.
video082802

@ujos
Copy link
Author

ujos commented Aug 28, 2024

@Evelyn-001 I have to add that I'm running VS Code on Linux. Looks like Visual Studio does not have bits/stdc++.h

Another option is to replace that include with the following. Please ensure you have a /Zc:__cplusplus parameter enabled.

#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cwchar>
#include <cwctype>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cuchar>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <codecvt>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

#if __cplusplus >= 201402L
#include <shared_mutex>
#endif

#if __cplusplus >= 201703L
#include <any>
#include <charconv>
// #include <execution>
#include <filesystem>
#include <optional>
#include <memory_resource>
#include <string_view>
#include <variant>
#endif

#if __cplusplus >= 202002L
#include <barrier>
#include <bit>
#include <compare>
#include <concepts>
#if __cpp_impl_coroutine
# include <coroutine>
#endif
#include <latch>
#include <numbers>
#include <ranges>
#include <span>
#include <stop_token>
#include <semaphore>
#include <source_location>
#include <syncstream>
#include <version>
#endif

#if __cplusplus > 202002L
#include <expected>
#include <spanstream>
#if __has_include(<stacktrace>)
# include <stacktrace>
#endif
#include <stdatomic.h>
#endif

@Evelyn-001
Copy link
Collaborator

@ujos , thanks for your reply. We just reproduced the problem of g++ output to TERMINAL tab in "Compile Active File" with your code. This problem can also be reproduced with simple code. Thanks.
video082903

@ujos
Copy link
Author

ujos commented Aug 29, 2024

@Evelyn-001 The output to TERMINAL is a part of the problem. Another problem is that VSCode is unable to catch the error message (so it does not appear in the PROBLEMS tab) if message is too long. Try to compile the code I posted above with the "Compile Active File" button.

@Evelyn-001
Copy link
Collaborator

@ujos, could you please share us a video for your clear repro steps in order to investigate that issue further? We are looking forward to hearing from you. Thanks.

@ujos
Copy link
Author

ujos commented Aug 30, 2024

[Window Title]
Visual Studio Code

[Main Instruction]
Visual Studio Code

[Content]

Version: 1.92.2 (system setup)
Commit: fee1edb8d6d72a0ddff41e5f71a671c23ed924b9
Date: 2024-08-14T17:29:30.058Z (2 wks ago)
Electron: 30.1.2
ElectronBuildId: 9870757
Chromium: 124.0.6367.243
Node.js: 20.14.0
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.19045

[Copy] [OK]
main.cpp.-.x.-.Visual.Studio.Code.2024-08-30.07-46-59.mp4

@v-frankwang
Copy link
Collaborator

@gcampbell-msft User's question: 1.User wants the compilation result to be displayed in the output window, is this a feature request? 2.User feels that the errors inside the compilation result should be displayed in the PROBLEMS window, I am not sure if this is a bug, can you give some suggestions? If it is a bug I will remind the user to create a new issue to track the this problem.

image

@gcampbell-msft
Copy link
Collaborator

@v-frankwang My reading of this is that it's a feature request. Thanks.

@gcampbell-msft gcampbell-msft moved this from Blocked to Pending Prioritization in CMake Tools Oct 2, 2024
@gcampbell-msft gcampbell-msft added this to the Backlog milestone Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: build
Projects
Status: Pending Prioritization
Development

No branches or pull requests

5 participants