intellism / vscode-comment-translate

vscode 注释翻译插件, 不干扰正常代码,方便快速阅读源码。
https://marketplace.visualstudio.com/items?itemName=intellsmi.comment-translate
MIT License
493 stars 78 forks source link

识别时有时会将正文行拼接到标题行,导致正文部分被放大加粗并且影响翻译 #201

Closed Arteiimis closed 2 weeks ago

Arteiimis commented 8 months ago

1706516426906 1706516433671

如图,会导致阅读体验变差

intellism commented 7 months ago

方便提供下原始文本么。
以及翻译配置,使用的哪个翻译源服务。

Arteiimis commented 7 months ago

方便提供下原始文本么。 以及翻译配置,使用的哪个翻译源服务。


/// Creates a bounded mpsc channel for communicating between asynchronous tasks
/// with backpressure.
///
/// The channel will buffer up to the provided number of messages.  Once the
/// buffer is full, attempts to send new messages will wait until a message is
/// received from the channel. The provided buffer capacity must be at least 1.
///
/// All data sent on `Sender` will become available on `Receiver` in the same
/// order as it was sent.
///
/// The `Sender` can be cloned to `send` to the same channel from multiple code
/// locations. Only one `Receiver` is supported.
///
/// If the `Receiver` is disconnected while trying to `send`, the `send` method
/// will return a `SendError`. Similarly, if `Sender` is disconnected while
/// trying to `recv`, the `recv` method will return `None`.
///
/// # Panics
///
/// Panics if the buffer capacity is 0.
///
/// # Examples
///
/// ```rust
/// use tokio::sync::mpsc;
///
/// #[tokio::main]
/// async fn main() {
///     let (tx, mut rx) = mpsc::channel(100);
///
///     tokio::spawn(async move {
///         for i in 0..10 {
///             if let Err(_) = tx.send(i).await {
///                 println!("receiver dropped");
///                 return;
///             }
///         }
///     });
///
///     while let Some(i) = rx.recv().await {
///         println!("got = {}", i);
///     }
/// }
/// ```
#[track_caller]
pub fn channel<T>(buffer: usize) -> (Sender<T>, Receiver<T>) {
assert!(buffer > 0, "mpsc bounded channel requires buffer > 0");
let semaphore = Semaphore {
semaphore: semaphore::Semaphore::new(buffer),
bound: buffer,
};
let (tx, rx) = chan::channel(semaphore);
let tx = Sender::new(tx);
let rx = Receiver::new(rx);

(tx, rx)

}


时间有点久了,没有找到当时看的是哪个函数,但是这个问题在几乎所有悬浮窗口里都会出现,比如上面这段会变成这样:
![image](https://github.com/intellism/vscode-comment-translate/assets/94288976/7d16ca9b-6ff3-41d7-b447-9bd7cd4a2aa3)
![image](https://github.com/intellism/vscode-comment-translate/assets/94288976/52993d76-5d6a-4d89-a6db-4c5764261ed9)

我使用的是google翻译源,换过几个不同的翻译源,这个问题都会出现
intellism commented 7 months ago

收到,markdown的处理可能有问题。