-
Notifications
You must be signed in to change notification settings - Fork 454
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
Comments
@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? |
@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. |
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);
} |
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. |
Thank you @bobbrow very much for assistance |
@Evelyn-001 I have to add that I'm running VS Code on Linux. Looks like Visual Studio does not have Another option is to replace that include with the following. Please ensure you have a #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 |
@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. |
@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. |
@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. |
main.cpp.-.x.-.Visual.Studio.Code.2024-08-30.07-46-59.mp4 |
@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. |
@v-frankwang My reading of this is that it's a feature request. Thanks. |
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.
The text was updated successfully, but these errors were encountered: