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

[IDEA-328501] Support semantic highlighting for Dart / Support Rainbow Variables for Dart #2741

Open
Locter9001 opened this issue Jun 4, 2024 · 1 comment
Labels
feature request In the next release language specific this feature/issue only effect on specific languages

Comments

@Locter9001
Copy link

Have you checked the issues and discussions to ensure there are no duplicates?

Yes

Your programming languages

Dart

Free or paid?

Paid users

Expected Behavior

Dart variables color

Code snippet for test

import 'package:flutter/material.dart';
import 'dart:io';

class WiFiSerialCommunication extends StatefulWidget {
  @override
  _WiFiSerialCommunicationState createState() => _WiFiSerialCommunicationState();
}

class _WiFiSerialCommunicationState extends State<WiFiSerialCommunication> {
  Socket? _socket;

  void connectToDevice(String ip, int port) async {
    try {
      _socket = await Socket.connect(ip, port);
      print('Connected to: ${_socket!.remoteAddress.address}:${_socket!.remotePort}');

      // Listen for responses from the server
      _socket!.listen((data) {
        print('Received: ${String.fromCharCodes(data)}');
      });
    } catch (e) {
      print('Failed to connect: $e');
    }
  }

  void sendMessage(String message) {
    if (_socket != null) {
      _socket!.add(utf8.encode(message));
    }
  }

  @override
  void dispose() {
    _socket?.close();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Wi-Fi Serial Communication'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            ElevatedButton(
              onPressed: () {
                connectToDevice('192.168.1.100', 23); // Replace with your device IP and port
              },
              child: Text('Connect to Device'),
            ),
            ElevatedButton(
              onPressed: () {
                sendMessage('Hello Device');
              },
              child: Text('Send Message'),
            ),
          ],
        ),
      ),
    );
  }
}

Your Environment

Android Studio Koala | 2024.1.1 RC 1
Build #AI-241.15989.150.2411.11887322, built on May 25, 2024
Runtime version: 17.0.10+0--11609105 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11.0
GC: G1 Young Generation, G1 Old Generation
Memory: 3072M
Cores: 20
Registry:
debugger.new.tool.window.layout=true
ide.experimental.ui=true
terminal.new.ui=true
Non-Bundled Plugins:
com.intellij.marketplace (241.15989.199)
Dart (241.17502)
izhangzhihao.rainbow.brackets (2024.2.4-241)
io.flutter (79.2.3)
cn.yiiguxing.plugin.translate (3.6.1)

@izhangzhihao izhangzhihao added the language specific this feature/issue only effect on specific languages label Jun 5, 2024
@izhangzhihao
Copy link
Owner

I made some searches, I found that: IDEA-328501 Support semantic highlighting for Dart opened 7 years before.

So, without IDE's support, I can only do rule-based syntax highlighting, similar issues may happen like #2709

Currently, a modified version:
image

intellij-rainbow-brackets-2024.2.4-241.zip

@izhangzhihao izhangzhihao changed the title Can Dart variables color be supported? IDEA-328501 Support semantic highlighting for Dart / Support Rainbow Variables for Dart Jun 5, 2024
@izhangzhihao izhangzhihao changed the title IDEA-328501 Support semantic highlighting for Dart / Support Rainbow Variables for Dart [IDEA-328501] Support semantic highlighting for Dart / Support Rainbow Variables for Dart Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request In the next release language specific this feature/issue only effect on specific languages
Projects
None yet
Development

No branches or pull requests

2 participants